diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 1999-08-27 08:49:30 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 1999-08-27 08:49:30 +0000 |
commit | 5bd8be398dc84618fe19823b681c13f9b6d80c52 (patch) | |
tree | 6a6aa5d745634b19265afc86c31dc5f79cc365ca /usr.bin/newsyslog/newsyslog.c | |
parent | 3e798c6c9fb28680366c6bdfa33c43b69f1b77b7 (diff) |
Replace some strlen with sizeof() - 1.
Don't forget to malloc space for newline.
Suggested by aazubel@cnba.uba.ar; ok millert@
Diffstat (limited to 'usr.bin/newsyslog/newsyslog.c')
-rw-r--r-- | usr.bin/newsyslog/newsyslog.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/newsyslog/newsyslog.c b/usr.bin/newsyslog/newsyslog.c index 241b28c33f0..f1555f52b9a 100644 --- a/usr.bin/newsyslog/newsyslog.c +++ b/usr.bin/newsyslog/newsyslog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: newsyslog.c,v 1.19 1999/06/08 15:42:54 kstailey Exp $ */ +/* $OpenBSD: newsyslog.c,v 1.20 1999/08/27 08:49:29 fgsch Exp $ */ /* * Copyright (c) 1997, Jason Downs. All rights reserved. @@ -61,7 +61,7 @@ provided "as is" without express or implied warranty. */ #ifndef lint -static char rcsid[] = "$OpenBSD: newsyslog.c,v 1.19 1999/06/08 15:42:54 kstailey Exp $"; +static char rcsid[] = "$OpenBSD: newsyslog.c,v 1.20 1999/08/27 08:49:29 fgsch Exp $"; #endif /* not lint */ #ifndef CONF @@ -628,7 +628,7 @@ void domonitor(log, whom) if (*p == '/') *p = '_'; } - fname = (char *) malloc(strlen(STATS_DIR) + strlen(flog) + 17); + fname = (char *) malloc(sizeof(STATS_DIR) + strlen(flog) + 16); if (fname == NULL) err(1, "malloc"); @@ -719,7 +719,7 @@ FILE *openmail() char *cmdbuf; FILE *ret; - cmdbuf = (char *) malloc(strlen(SENDMAIL) + 3); + cmdbuf = (char *) malloc(sizeof(SENDMAIL) + 3); if (cmdbuf == NULL) return(NULL); |