summaryrefslogtreecommitdiffstats
path: root/sbin/hastd/hooks.c
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2011-03-21 08:37:50 +0000
committerpjd <pjd@FreeBSD.org>2011-03-21 08:37:50 +0000
commite06bfb0a1b558adcf3e1df4c2d54cb2f3d7541e6 (patch)
tree38c61a3dc448cba4fea0942f711b6944a066834c /sbin/hastd/hooks.c
parent895e0371a1b3bfa3af33880e3c4eb133ec226102 (diff)
downloadFreeBSD-src-e06bfb0a1b558adcf3e1df4c2d54cb2f3d7541e6.zip
FreeBSD-src-e06bfb0a1b558adcf3e1df4c2d54cb2f3d7541e6.tar.gz
Use snprlcat() instead of two strlcat(3)s.
MFC after: 1 week
Diffstat (limited to 'sbin/hastd/hooks.c')
-rw-r--r--sbin/hastd/hooks.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/hastd/hooks.c b/sbin/hastd/hooks.c
index 7bc9913..5692565 100644
--- a/sbin/hastd/hooks.c
+++ b/sbin/hastd/hooks.c
@@ -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.");
OpenPOWER on IntegriCloud