diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-01-03 00:06:46 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-01-03 00:06:46 +0000 |
commit | 5e8b3ea19d045110e8e324cab3208de275d66244 (patch) | |
tree | ed3367b9af6e3ab34dcb302a2f46ca9d604e67ab | |
parent | 58a408512b6d0eb4b0966ee2476cabb3a669b8cd (diff) | |
download | busybox-5e8b3ea19d045110e8e324cab3208de275d66244.tar.gz |
Logger forgot to NULL terminate strings from stdin.
-rw-r--r-- | logger.c | 2 | ||||
-rw-r--r-- | sysklogd/logger.c | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -130,6 +130,7 @@ extern int logger_main(int argc, char **argv) while ((c = getc(stdin)) != EOF && i < sizeof(buf)) { buf[i++] = c; } + buf[i++] = '\0'; message = buf; } else { len = 1; /* for the '\0' */ @@ -147,7 +148,6 @@ extern int logger_main(int argc, char **argv) openlog(name, option, (pri | LOG_FACMASK)); syslog(pri, "%s", message); closelog(); - return EXIT_SUCCESS; } diff --git a/sysklogd/logger.c b/sysklogd/logger.c index 21906401f..3d02979c8 100644 --- a/sysklogd/logger.c +++ b/sysklogd/logger.c @@ -130,6 +130,7 @@ extern int logger_main(int argc, char **argv) while ((c = getc(stdin)) != EOF && i < sizeof(buf)) { buf[i++] = c; } + buf[i++] = '\0'; message = buf; } else { len = 1; /* for the '\0' */ @@ -147,7 +148,6 @@ extern int logger_main(int argc, char **argv) openlog(name, option, (pri | LOG_FACMASK)); syslog(pri, "%s", message); closelog(); - return EXIT_SUCCESS; } |