aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--conf.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/conf.c b/conf.c
index 3b0cc486..66daee97 100644
--- a/conf.c
+++ b/conf.c
@@ -333,10 +333,9 @@ void dump_config(struct runctl *runp, struct query *querylist)
fprintf(stdout, "'localnames':[");
for (idp = ctl->localnames; idp; idp = idp->next)
{
- char namebuf[USERNAMELEN + 1];
+ char namebuf[USERNAMELEN + 1];
- strncpy(namebuf, visbuf(idp->id), USERNAMELEN);
- namebuf[USERNAMELEN] = '\0';
+ strlcpy(namebuf, visbuf(idp->id), sizeof(namebuf));
if (idp->val.id2)
fprintf(stdout, "(\"%s\", %s)", namebuf, visbuf(idp->val.id2));
else