From 28d410a5b5d16d8adbf96aaae4ef71d0ae938144 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Wed, 27 Jul 2011 12:43:02 +0000 Subject: Simply word allocation in libmdoc and libman. --- man.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'man.c') 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 * @@ -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); -- cgit v1.2.3-56-ge451