diff options
-rw-r--r-- | man.c | 9 | ||||
-rw-r--r-- | mdoc.c | 9 |
2 files changed, 2 insertions, 16 deletions
@@ -320,16 +320,9 @@ int man_word_alloc(struct man *m, int line, int pos, const char *word) { struct man_node *n; - size_t sv, len; - - len = strlen(word); n = man_node_alloc(m, line, pos, MAN_TEXT, MAN_MAX); - n->string = mandoc_malloc(len + 1); - sv = strlcpy(n->string, word, len + 1); - - /* Prohibit truncation. */ - assert(sv < len + 1); + n->string = mandoc_strdup(word); if ( ! man_node_append(m, n)) return(0); @@ -568,16 +568,9 @@ int mdoc_word_alloc(struct mdoc *m, int line, int pos, const char *p) { struct mdoc_node *n; - size_t sv, len; - - len = strlen(p); n = node_alloc(m, line, pos, MDOC_MAX, MDOC_TEXT); - n->string = mandoc_malloc(len + 1); - sv = strlcpy(n->string, p, len + 1); - - /* Prohibit truncation. */ - assert(sv < len + 1); + n->string = mandoc_strdup(p); if ( ! node_append(m, n)) return(0); |