diff options
author | Erik Andersen <andersen@codepoet.org> | 2000-01-09 09:49:08 +0300 |
---|---|---|
committer | Erik Andersen <andersen@codepoet.org> | 2000-01-09 09:49:08 +0300 |
commit | 9a9a261569df0c88038de48eb233890ca189e9c0 (patch) | |
tree | 4507d48158b954b221857c5b630a45c9a29a1480 | |
parent | ac6e71f0c4150e9394b0a424e9d64750bcfacb85 (diff) |
Fix a logger bug.
-Erik
-rw-r--r-- | Changelog | 3 | ||||
-rw-r--r-- | logger.c | 2 | ||||
-rw-r--r-- | sysklogd/logger.c | 2 |
3 files changed, 5 insertions, 2 deletions
@@ -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, @@ -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 35bbb6692..7aada5dbc 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); |