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

Diff for /mandoc/mdoc.c between version 1.193 and 1.194

version 1.193, 2011/07/27 12:41:02 version 1.194, 2011/07/27 12:43:02
Line 568  int
Line 568  int
 mdoc_word_alloc(struct mdoc *m, int line, int pos, const char *p)  mdoc_word_alloc(struct mdoc *m, int line, int pos, const char *p)
 {  {
         struct mdoc_node *n;          struct mdoc_node *n;
         size_t            sv, len;  
   
         len = strlen(p);  
   
         n = node_alloc(m, line, pos, MDOC_MAX, MDOC_TEXT);          n = node_alloc(m, line, pos, MDOC_MAX, MDOC_TEXT);
         n->string = mandoc_malloc(len + 1);          n->string = mandoc_strdup(p);
         sv = strlcpy(n->string, p, len + 1);  
   
         /* Prohibit truncation. */  
         assert(sv < len + 1);  
   
         if ( ! node_append(m, n))          if ( ! node_append(m, n))
                 return(0);                  return(0);

Legend:
Removed from v.1.193  
changed lines
  Added in v.1.194

CVSweb