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

Diff for /mandoc/man.c between version 1.109 and 1.110

version 1.109, 2011/07/21 10:24:35 version 1.110, 2011/07/27 12:43:02
Line 320  int
Line 320  int
 man_word_alloc(struct man *m, int line, int pos, const char *word)  man_word_alloc(struct man *m, int line, int pos, const char *word)
 {  {
         struct man_node *n;          struct man_node *n;
         size_t           sv, len;  
   
         len = strlen(word);  
   
         n = man_node_alloc(m, line, pos, MAN_TEXT, MAN_MAX);          n = man_node_alloc(m, line, pos, MAN_TEXT, MAN_MAX);
         n->string = mandoc_malloc(len + 1);          n->string = mandoc_strdup(word);
         sv = strlcpy(n->string, word, len + 1);  
   
         /* Prohibit truncation. */  
         assert(sv < len + 1);  
   
         if ( ! man_node_append(m, n))          if ( ! man_node_append(m, n))
                 return(0);                  return(0);

Legend:
Removed from v.1.109  
changed lines
  Added in v.1.110

CVSweb