diff options
author | dwmalone <dwmalone@FreeBSD.org> | 2000-08-03 15:12:06 +0000 |
---|---|---|
committer | dwmalone <dwmalone@FreeBSD.org> | 2000-08-03 15:12:06 +0000 |
commit | 91c8cf2367a599d429247f35efe46ac1d110a54d (patch) | |
tree | d2770483fc3b811175e205882efe56f2ddfccb46 | |
parent | d3ae9e37cd81d8e346cb4bc5692267ae1fbf8897 (diff) | |
download | FreeBSD-src-91c8cf2367a599d429247f35efe46ac1d110a54d.zip FreeBSD-src-91c8cf2367a599d429247f35efe46ac1d110a54d.tar.gz |
Replace two calls to strlen+calloc+strcpy with strdup.
Reviewed by: sheldonh
-rw-r--r-- | usr.sbin/syslogd/syslogd.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index fed82f2..9b86553 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -1445,21 +1445,13 @@ cfline(line, f, prog, host) /* save hostname if any */ if (host && *host == '*') host = NULL; - if (host) { - f->f_host = calloc(1, strlen(host)+1); - if (f->f_host) { - strcpy(f->f_host, host); - } - } + if (host) + f->f_host = strdup(host); /* save program name if any */ if(prog && *prog=='*') prog = NULL; - if(prog) { - f->f_program = calloc(1, strlen(prog)+1); - if(f->f_program) { - strcpy(f->f_program, prog); - } - } + if(prog) + f->f_program = strdup(host); /* scan through the list of selectors */ for (p = line; *p && *p != '\t' && *p != ' ';) { |