[BACK]Return to genhash CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libterminfo

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/lib/libterminfo/genhash between version 1.8 and 1.9

version 1.8, 2011/11/02 12:09:25 version 1.9, 2017/01/11 20:53:52
Line 65  const char *
Line 65  const char *
 _ti_${name}id(ssize_t idx)  _ti_${name}id(ssize_t idx)
 {  {
   
         if ((size_t)idx > __arraycount(_ti_${name}ids))          if ((size_t)idx >= __arraycount(_ti_${name}ids))
                 return NULL;                  return NULL;
         return _ti_${name}ids[idx];          return _ti_${name}ids[idx];
 }  }
Line 76  _ti_${name}index(const char *key)
Line 76  _ti_${name}index(const char *key)
         uint32_t idx;          uint32_t idx;
   
         idx = _ti_${name}hash((const unsigned char *)key, strlen(key));          idx = _ti_${name}hash((const unsigned char *)key, strlen(key));
         if (idx > __arraycount(_ti_${name}ids) ||          if (idx >= __arraycount(_ti_${name}ids) ||
             strcmp(key, _ti_${name}ids[idx]) != 0)              strcmp(key, _ti_${name}ids[idx]) != 0)
                 return -1;                  return -1;
         return idx;          return idx;

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

CVSweb <webmaster@jp.NetBSD.org>