Browse Source

* simdb_record_used() : fix return value

master
Alex 'AdUser' Z 7 years ago
parent
commit
20217309cf
  1. 4
      src/database.c

4
src/database.c

@ -258,6 +258,7 @@ simdb_record_used(simdb_t *db, int num) {
int
simdb_record_add(simdb_t *db, int num, const char *path, int flags) {
simdb_urec_t *rec = NULL;
int ret = 0;
assert(db != NULL);
@ -279,7 +280,8 @@ simdb_record_add(simdb_t *db, int num, const char *path, int flags) {
if (num == 0)
num = db->records + 1;
num = simdb_write(db, num, 1, rec);
if ((ret = simdb_write(db, num, 1, rec)) <= 0)
num = ret;
FREE(rec);
return num;

Loading…
Cancel
Save