From 283a645a5be6be0f447ac0aa651b641dbb6b5fc4 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Thu, 2 Apr 2009 16:37:40 +0000 Subject: Added -p1003.1-2008 specification. Fixed invalid memory accesses (concat()). Made -fign-macro be the default for libman. --- mdoc_action.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mdoc_action.c') diff --git a/mdoc_action.c b/mdoc_action.c index cd423964..c22fd086 100644 --- a/mdoc_action.c +++ b/mdoc_action.c @@ -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.4 2009/04/02 16:37:40 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 @@ -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)); -- cgit v1.2.3-56-ge451