Browse Source

* simdb_search_byid() report an error if try to use missing record

master
Alex 'AdUser' Z 8 years ago
parent
commit
a97d108a57
  1. 3
      src/database.c

3
src/database.c

@ -488,6 +488,9 @@ simdb_search_byid(simdb_t *db, simdb_search_t *search, int num) {
if ((ret = simdb_read(db, num, 1, &sample)) < 1) if ((ret = simdb_read(db, num, 1, &sample)) < 1)
return ret; return ret;
if (!sample->used)
return SIMDB_ERR_NXRECORD;
ret = simdb_search(db, search, sample, num); ret = simdb_search(db, search, sample, num);
FREE(sample); FREE(sample);

Loading…
Cancel
Save