forked from github/server
CID 32303 Unchecked return value
appeasing coverity
This commit is contained in:
parent
32c777d428
commit
66e43caf9d
1 changed files with 5 additions and 3 deletions
|
@ -2978,7 +2978,7 @@ spellbook * get_spellbook(const char * name)
|
|||
spellbook * result;
|
||||
void * match;
|
||||
|
||||
if (cb_find_prefix(&cb_spellbooks, name, strlen(name), &match, 1, 0)) {
|
||||
if (cb_find_prefix(&cb_spellbooks, name, strlen(name), &match, 1, 0) > 0) {
|
||||
cb_get_kv(match, &result, sizeof(result));
|
||||
}
|
||||
else {
|
||||
|
@ -2990,8 +2990,10 @@ spellbook * get_spellbook(const char * name)
|
|||
log_error("cb_insert failed although cb_find returned nothing for spellbook=%s", name);
|
||||
assert(!"should not happen");
|
||||
}
|
||||
cb_find_prefix(&cb_spellbooks, name, strlen(name), &match, 1, 0);
|
||||
cb_get_kv(match, &result, sizeof(result));
|
||||
result = 0;
|
||||
if (cb_find_prefix(&cb_spellbooks, name, strlen(name), &match, 1, 0) > 0) {
|
||||
cb_get_kv(match, &result, sizeof(result));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue