summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbri <bri@cvs.openbsd.org>1997-11-07 20:56:03 +0000
committerbri <bri@cvs.openbsd.org>1997-11-07 20:56:03 +0000
commit5c96b96b07e855447b151f82dd52a52826f8f974 (patch)
treeac51df238b0b41817a467e647c7df8b68a76f6d1
parent759703462367e220fb41b2668b2a0f10d1f76594 (diff)
Rewrite bad code.
Suggested by: Theo
-rw-r--r--usr.sbin/syslogd/syslogd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index 5773050ee93..4735b07c0f7 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -953,7 +953,7 @@ init(signo)
*/
for (p = cline; isspace(*p); ++p)
continue;
- if (*p == NULL)
+ if (*p == '\0')
continue;
if (*p == '#') {
p++;
@@ -976,9 +976,13 @@ init(signo)
prog[i] = 0;
continue;
}
- for (p = strchr(cline, '\0'); isspace(*--p);)
- continue;
- *++p = '\0';
+ p = cline + strlen(cline);
+ while (p > cline)
+ if (!isspace(*--p)) {
+ p++;
+ break;
+ }
+ *p = '\0';
f = (struct filed *)calloc(1, sizeof(*f));
*nextp = f;
nextp = &f->f_next;