Date: Mon, 21 Mar 2011 08:37:50 +0000 (UTC) From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r219816 - head/sbin/hastd Message-ID: <201103210837.p2L8bpHC004949@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pjd Date: Mon Mar 21 08:37:50 2011 New Revision: 219816 URL: http://svn.freebsd.org/changeset/base/219816 Log: Use snprlcat() instead of two strlcat(3)s. MFC after: 1 week Modified: head/sbin/hastd/hooks.c Modified: head/sbin/hastd/hooks.c ============================================================================== --- head/sbin/hastd/hooks.c Mon Mar 21 08:36:50 2011 (r219815) +++ head/sbin/hastd/hooks.c Mon Mar 21 08:37:50 2011 (r219816) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include <pjdlog.h> #include "hooks.h" +#include "subr.h" #include "synch.h" /* Report processes that are running for too long not often than this value. */ @@ -184,8 +185,8 @@ hook_alloc(const char *path, char **args (void)strlcpy(hp->hp_comm, path, sizeof(hp->hp_comm)); /* We start at 2nd argument as we don't want to have exec name twice. */ for (ii = 1; args[ii] != NULL; ii++) { - (void)strlcat(hp->hp_comm, " ", sizeof(hp->hp_comm)); - (void)strlcat(hp->hp_comm, args[ii], sizeof(hp->hp_comm)); + (void)snprlcat(hp->hp_comm, sizeof(hp->hp_comm), " %s", + args[ii]); } if (strlen(hp->hp_comm) >= sizeof(hp->hp_comm) - 1) { pjdlog_error("Exec path too long, correct configuration file.");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103210837.p2L8bpHC004949>