Logger forgot to NULL terminate strings from stdin.

This commit is contained in:
Eric Andersen 2001-01-03 00:06:46 +00:00
parent 58a408512b
commit 5e8b3ea19d
2 changed files with 2 additions and 2 deletions

View File

@ -130,6 +130,7 @@ extern int logger_main(int argc, char **argv)
while ((c = getc(stdin)) != EOF && i < sizeof(buf)) { while ((c = getc(stdin)) != EOF && i < sizeof(buf)) {
buf[i++] = c; buf[i++] = c;
} }
buf[i++] = '\0';
message = buf; message = buf;
} else { } else {
len = 1; /* for the '\0' */ len = 1; /* for the '\0' */
@ -147,7 +148,6 @@ extern int logger_main(int argc, char **argv)
openlog(name, option, (pri | LOG_FACMASK)); openlog(name, option, (pri | LOG_FACMASK));
syslog(pri, "%s", message); syslog(pri, "%s", message);
closelog(); closelog();
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }

View File

@ -130,6 +130,7 @@ extern int logger_main(int argc, char **argv)
while ((c = getc(stdin)) != EOF && i < sizeof(buf)) { while ((c = getc(stdin)) != EOF && i < sizeof(buf)) {
buf[i++] = c; buf[i++] = c;
} }
buf[i++] = '\0';
message = buf; message = buf;
} else { } else {
len = 1; /* for the '\0' */ len = 1; /* for the '\0' */
@ -147,7 +148,6 @@ extern int logger_main(int argc, char **argv)
openlog(name, option, (pri | LOG_FACMASK)); openlog(name, option, (pri | LOG_FACMASK));
syslog(pri, "%s", message); syslog(pri, "%s", message);
closelog(); closelog();
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }