diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2014-11-01 12:07:42 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2014-11-01 12:07:42 +0000 |
commit | 25581e9d7ab7bfd4852e8f466a3320ae0bd63781 (patch) | |
tree | 790a047f401ab9e31cf2c929956937cb0416e72f /usr.sbin | |
parent | 57dc70fa3838651723aaa0b06ac3effbce1f4b0e (diff) |
Replace the combination of strlen(), calloc(), strlen(), strlcpy()
with a simple strdup().
Found by brad@ with LLVM; OK doug@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/syslogd/syslogd.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index 5f35d0374b0..98cda562d0a 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syslogd.c,v 1.129 2014/10/06 19:36:34 bluhm Exp $ */ +/* $OpenBSD: syslogd.c,v 1.130 2014/11/01 12:07:41 bluhm Exp $ */ /* * Copyright (c) 1983, 1988, 1993, 1994 @@ -1469,11 +1469,8 @@ cfline(char *line, char *prog) f->f_quick = 0; if (!strcmp(prog, "*")) prog = NULL; - else { - f->f_program = calloc(1, strlen(prog)+1); - if (f->f_program) - strlcpy(f->f_program, prog, strlen(prog)+1); - } + else + f->f_program = strdup(prog); /* scan through the list of selectors */ for (p = line; *p && *p != '\t';) { |