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

Diff for /mandoc/mandocdb.c between version 1.50 and 1.51

version 1.50, 2012/06/08 10:43:01 version 1.51, 2012/06/08 12:05:27
Line 79  struct str {
Line 79  struct str {
         const struct of *of; /* if set, the owning parse */          const struct of *of; /* if set, the owning parse */
         struct str      *next; /* next in owning parse sequence */          struct str      *next; /* next in owning parse sequence */
         uint64_t         mask; /* bitmask in sequence */          uint64_t         mask; /* bitmask in sequence */
         char             key[1]; /* the string itself */          char             key[]; /* the string itself */
 };  };
   
 struct  id {  struct  id {
Line 1538  straddbuf(const char *cp, size_t sz)
Line 1538  straddbuf(const char *cp, size_t sz)
         if (NULL != (s = hashget(cp, sz)))          if (NULL != (s = hashget(cp, sz)))
                 return(s->key);                  return(s->key);
   
         s = mandoc_calloc(sizeof(struct str) + sz, 1);          s = mandoc_calloc(sizeof(struct str) + sz + 1, 1);
         memcpy(s->key, cp, sz);          memcpy(s->key, cp, sz);
   
         end = cp + sz;          end = cp + sz;
Line 1585  wordaddbuf(const struct of *of, 
Line 1585  wordaddbuf(const struct of *of, 
                 s->mask |= v;                  s->mask |= v;
                 return;                  return;
         } else if (NULL == s) {          } else if (NULL == s) {
                 s = mandoc_calloc(sizeof(struct str) + sz, 1);                  s = mandoc_calloc(sizeof(struct str) + sz + 1, 1);
                 memcpy(s->key, cp, sz);                  memcpy(s->key, cp, sz);
                 end = cp + sz;                  end = cp + sz;
                 index = ohash_qlookupi(&strings, cp, &end);                  index = ohash_qlookupi(&strings, cp, &end);

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.51

CVSweb