mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-18 10:46:38 +00:00
Update sdb
This commit is contained in:
parent
21fb73d1f8
commit
011ebf7e03
@ -301,6 +301,10 @@ SDB_API HT_(Kv)* Ht_(find_kv)(HtName_(Ht)* ht, const KEY_TYPE key, bool* found)
|
|||||||
if (found) {
|
if (found) {
|
||||||
*found = false;
|
*found = false;
|
||||||
}
|
}
|
||||||
|
if (!ht) {
|
||||||
|
*found = false;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
HT_(Bucket) *bt = &ht->table[bucketfn (ht, key)];
|
HT_(Bucket) *bt = &ht->table[bucketfn (ht, key)];
|
||||||
ut32 key_len = calcsize_key (ht, key);
|
ut32 key_len = calcsize_key (ht, key);
|
||||||
|
@ -368,13 +368,12 @@ SDB_API int sdb_add(Sdb* s, const char *key, const char *val, ut32 cas) {
|
|||||||
SDB_API bool sdb_exists(Sdb* s, const char *key) {
|
SDB_API bool sdb_exists(Sdb* s, const char *key) {
|
||||||
ut32 pos;
|
ut32 pos;
|
||||||
char ch;
|
char ch;
|
||||||
SdbKv *kv;
|
|
||||||
bool found;
|
bool found;
|
||||||
int klen = strlen (key) + 1;
|
int klen = strlen (key) + 1;
|
||||||
if (!s) {
|
if (!s) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
kv = (SdbKv*)sdb_ht_find_kvp (s->ht, key, &found);
|
SdbKv *kv = (SdbKv*)sdb_ht_find_kvp (s->ht, key, &found);
|
||||||
if (found && kv) {
|
if (found && kv) {
|
||||||
char *v = sdbkv_value (kv);
|
char *v = sdbkv_value (kv);
|
||||||
return v && *v;
|
return v && *v;
|
||||||
|
Loading…
Reference in New Issue
Block a user