=================================================================== RCS file: /cvs/mandoc/Attic/mdoc_action.c,v retrieving revision 1.3 retrieving revision 1.5 diff -u -p -r1.3 -r1.5 --- mandoc/Attic/mdoc_action.c 2009/04/02 06:51:44 1.3 +++ mandoc/Attic/mdoc_action.c 2009/04/03 11:08:39 1.5 @@ -1,4 +1,4 @@ -/* $Id: mdoc_action.c,v 1.3 2009/04/02 06:51:44 kristaps Exp $ */ +/* $Id: mdoc_action.c,v 1.5 2009/04/03 11:08:39 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -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 @@ -344,6 +343,8 @@ post_nm(POST_ARGS) if (m->meta.name) return(1); + + buf[0] = 0; if ( ! concat(m, m->last->child, buf, sizeof(buf))) return(0); if (NULL == (m->meta.name = strdup(buf))) @@ -367,6 +368,8 @@ post_sh(POST_ARGS) if (MDOC_HEAD != m->last->type) return(1); + + buf[0] = 0; if ( ! concat(m, m->last->child, buf, sizeof(buf))) return(0); if (SEC_CUSTOM != (sec = mdoc_atosec(buf))) @@ -495,13 +498,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)); @@ -693,6 +698,7 @@ post_dd(POST_ARGS) { char buf[64]; + buf[0] = 0; if ( ! concat(m, m->last->child, buf, sizeof(buf))) return(0);