summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-06-11 20:51:17 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-06-11 20:51:17 +0000
commit1e84ce2016c5b11019642dd0a4147c311dd1fcc3 (patch)
treef626db511ec6aa7455c4996119f3c049732d600c /usr.sbin
parentb8be5dce160c9ea7b2327f04818b786dd4fec322 (diff)
bogus use of variable for two purposes; guido@gvr.org
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/syslogd/syslogd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index 4a098785ff9..d04449d59e6 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -393,12 +393,12 @@ main(argc, argv)
for (i = 0; i < nfunix; i++) {
if (funix[i] != -1 && FD_ISSET(funix[i], &readfds)) {
len = sizeof(fromunix);
- i = recvfrom(funix[i], line, MAXLINE, 0,
+ len = recvfrom(funix[i], line, MAXLINE, 0,
(struct sockaddr *)&fromunix, &len);
- if (i > 0) {
- line[i] = '\0';
+ if (len > 0) {
+ line[len] = '\0';
printline(LocalHostName, line);
- } else if (i < 0 && errno != EINTR)
+ } else if (len < 0 && errno != EINTR)
logerror("recvfrom unix");
}
}