[BACK]Return to dbm_map.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/dbm_map.c between version 1.3 and 1.5

version 1.3, 2016/08/05 23:15:08 version 1.5, 2016/08/30 21:37:24
Line 80  dbm_map(const char *fname)
Line 80  dbm_map(const char *fname)
                 goto fail;                  goto fail;
         magic = dbm_getint(0);          magic = dbm_getint(0);
         if (be32toh(*magic) != MANDOCDB_MAGIC) {          if (be32toh(*magic) != MANDOCDB_MAGIC) {
                 warnx("dbm_map(%s): Bad initial magic %x (expected %x)",                  if (strncmp(dbm_base, "SQLite format 3", 15))
                     fname, be32toh(*magic), MANDOCDB_MAGIC);                          warnx("dbm_map(%s): "
                               "Bad initial magic %x (expected %x)",
                               fname, be32toh(*magic), MANDOCDB_MAGIC);
                   else
                           warnx("dbm_map(%s): "
                               "Obsolete format based on SQLite 3",
                               fname);
                 errno = EFTYPE;                  errno = EFTYPE;
                 goto fail;                  goto fail;
         }          }
Line 137  void *
Line 143  void *
 dbm_get(int32_t offset)  dbm_get(int32_t offset)
 {  {
         offset = be32toh(offset);          offset = be32toh(offset);
         if (offset < 0 || offset >= max_offset) {          if (offset < 0) {
                   warnx("dbm_get: Database corrupt: offset %d", offset);
                   return NULL;
           }
           if (offset >= max_offset) {
                 warnx("dbm_get: Database corrupt: offset %d > %d",                  warnx("dbm_get: Database corrupt: offset %d > %d",
                     offset, max_offset);                      offset, max_offset);
                 return NULL;                  return NULL;

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.5

CVSweb