Add errno.h
[oweals/busybox.git] / logger.c
index 21906401f502c7df5cf7bc1c29902d41ce81efc9..3d02979c86a119ad7b5544d2c48e05d1de8cc2b4 100644 (file)
--- a/logger.c
+++ b/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;
 }