DtMmdb: fix a crash occurs when creating bookmark.

This commit is contained in:
hyousatsu
2024-07-14 17:40:05 +00:00
parent f0123efa84
commit 121510cb72
5 changed files with 19 additions and 64 deletions

View File

@@ -91,7 +91,7 @@ oid_t::oid_t(const char* source, Boolean ascii_format, Boolean swap_order)
memcpy((char*)&v_i_code, source, sizeof(v_i_code));
if ( swap_order == true )
ORDER_SWAP_LONG(v_i_code);
ORDER_SWAP_I_CODE_T(v_i_code);
} else {
istringstream in((char*)source);
@@ -248,7 +248,7 @@ void oid_t::to_char_string(char* sink, Boolean swap_order) const
if ( swap_order == true ) {
i_code_t x = v_i_code;
ORDER_SWAP_LONG(x);
ORDER_SWAP_I_CODE_T(x);
memcpy(sink, (char*)&x, sizeof(x));
} else
memcpy(sink, (char*)&v_i_code, sizeof(v_i_code));

View File

@@ -65,6 +65,7 @@ typedef unsigned short c_code_t;
typedef mmdb_pos_t i_code_t;
#define OID_T_SZ (sizeof(i_code_t))
#define ORDER_SWAP_I_CODE_T(x) ORDER_SWAP(i_code_t, x)
/*************************************
// class code root