aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-07-27 12:43:02 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-07-27 12:43:02 +0000
commit28d410a5b5d16d8adbf96aaae4ef71d0ae938144 (patch)
treec520b69d0c306ab2b613afe1046be2cdb4f5536e /man.c
parent41fb753e38e93d33d278d5b1ec34681285bc19f6 (diff)
downloadmandoc-28d410a5b5d16d8adbf96aaae4ef71d0ae938144.tar.gz
mandoc-28d410a5b5d16d8adbf96aaae4ef71d0ae938144.tar.zst
mandoc-28d410a5b5d16d8adbf96aaae4ef71d0ae938144.zip
Simply word allocation in libmdoc and libman.
Diffstat (limited to 'man.c')
-rw-r--r--man.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/man.c b/man.c
index 593777ac..9d480e10 100644
--- a/man.c
+++ b/man.c
@@ -1,4 +1,4 @@
-/* $Id: man.c,v 1.109 2011/07/21 10:24:35 kristaps Exp $ */
+/* $Id: man.c,v 1.110 2011/07/27 12:43:02 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -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);