summaryrefslogtreecommitdiffstats
path: root/mdoc_action.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-04-02 16:37:40 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-04-02 16:37:40 +0000
commitc6f2ac2795830a6dad4bb85a704413a2a9f0333c (patch)
tree9df4689f8928c8f1033961943dbd63bd89182b08 /mdoc_action.c
parentcdb6fd7e9ca0c4e288d47005adc9c5de83127a32 (diff)
downloadmandoc-c6f2ac2795830a6dad4bb85a704413a2a9f0333c.tar.gz
Added -p1003.1-2008 specification.
Fixed invalid memory accesses (concat()). Made -fign-macro be the default for libman.
Diffstat (limited to 'mdoc_action.c')
-rw-r--r--mdoc_action.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mdoc_action.c b/mdoc_action.c
index a13412ee..21f3ce42 100644
--- a/mdoc_action.c
+++ b/mdoc_action.c
@@ -195,7 +195,6 @@ const struct actions mdoc_actions[MDOC_MAX] = {
#ifdef __linux__
-extern size_t strlcpy(char *, const char *, size_t);
extern size_t strlcat(char *, const char *, size_t);
#endif
@@ -495,13 +494,15 @@ post_os(POST_ARGS)
if (m->meta.os)
free(m->meta.os);
+
+ buf[0] = 0;
if ( ! concat(m, m->last->child, buf, sizeof(buf)))
return(0);
if (0 == buf[0]) {
if (-1 == uname(&utsname))
return(mdoc_err(m, "utsname"));
- if (strlcpy(buf, utsname.sysname, 64) >= 64)
+ if (strlcat(buf, utsname.sysname, 64) >= 64)
return(verr(m, ETOOLONG));
if (strlcat(buf, " ", 64) >= 64)
return(verr(m, ETOOLONG));