summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog3
-rw-r--r--logger.c2
-rw-r--r--sysklogd/logger.c2
3 files changed, 5 insertions, 2 deletions
diff --git a/Changelog b/Changelog
index 52b34b6..8235980 100644
--- a/Changelog
+++ b/Changelog
@@ -2,6 +2,9 @@
* Fixed a bug in both cp and mv preventing 'cp foo/README bar'
type commands (file in a directory to another directory)
from working.
+ * Fixed a logger bug that caused garbage to be written to the syslog
+ (unless you used busybox syslog, which hid the bug). Thanks
+ to Alex Holden <alex@linuxhacker.org> for the fix.
-Erik Andersen,
diff --git a/logger.c b/logger.c
index 35bbb66..7aada5d 100644
--- a/logger.c
+++ b/logger.c
@@ -186,7 +186,7 @@ extern int logger_main(int argc, char **argv)
if (toStdErrFlag==TRUE)
fprintf(stderr, "%s\n", buf);
- write( fd, buf, sizeof(buf));
+ write( fd, buf, strlen(buf)+1);
close(fd);
exit( TRUE);
diff --git a/sysklogd/logger.c b/sysklogd/logger.c
index 35bbb66..7aada5d 100644
--- a/sysklogd/logger.c
+++ b/sysklogd/logger.c
@@ -186,7 +186,7 @@ extern int logger_main(int argc, char **argv)
if (toStdErrFlag==TRUE)
fprintf(stderr, "%s\n", buf);
- write( fd, buf, sizeof(buf));
+ write( fd, buf, strlen(buf)+1);
close(fd);
exit( TRUE);