fix cb_insert comparison (new return value for success)

This commit is contained in:
Enno Rehling 2015-11-05 13:01:48 +01:00
parent dcc819491f
commit 797eee025d
2 changed files with 2 additions and 1 deletions

View File

@ -38,6 +38,7 @@ static void test_readwrite_unit(CuTest * tc)
f = test_create_faction(0);
fno = f->no;
u = test_create_unit(f, r);
_mkdir(datapath());
sprintf(path, "%s/%s", datapath(), filename);
data = gamedata_open(path, "wb");

View File

@ -73,7 +73,7 @@ spell * create_spell(const char * name, unsigned int id)
}
sp = (spell *)calloc(1, sizeof(spell));
len = cb_new_kv(name, len, &sp, sizeof(sp), buffer);
if (cb_insert(&cb_spells, buffer, len)) {
if (cb_insert(&cb_spells, buffer, len) == CB_SUCCESS) {
sp->id = id ? id : hashstring(name);
sp->sname = _strdup(name);
add_spell(&spells, sp);