summaryrefslogtreecommitdiff
path: root/sysklogd/logger.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysklogd/logger.c')
-rw-r--r--sysklogd/logger.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sysklogd/logger.c b/sysklogd/logger.c
index df5d8ff7e..6e1debd67 100644
--- a/sysklogd/logger.c
+++ b/sysklogd/logger.c
@@ -107,7 +107,7 @@ int logger_main(int argc, char **argv)
107 argv += optind; 107 argv += optind;
108 if (!argc) { 108 if (!argc) {
109#define strbuf bb_common_bufsiz1 109#define strbuf bb_common_bufsiz1
110 while (fgets(strbuf, BUFSIZ, stdin)) { 110 while (fgets(strbuf, COMMON_BUFSIZE, stdin)) {
111 if (strbuf[0] 111 if (strbuf[0]
112 && NOT_LONE_CHAR(strbuf, '\n') 112 && NOT_LONE_CHAR(strbuf, '\n')
113 ) { 113 ) {
@@ -117,11 +117,11 @@ int logger_main(int argc, char **argv)
117 } 117 }
118 } else { 118 } else {
119 char *message = NULL; 119 char *message = NULL;
120 int len = 1; /* for NUL */ 120 int len = 0;
121 int pos = 0; 121 int pos = 0;
122 do { 122 do {
123 len += strlen(*argv) + 1; 123 len += strlen(*argv) + 1;
124 message = xrealloc(message, len); 124 message = xrealloc(message, len + 1);
125 sprintf(message + pos, " %s", *argv), 125 sprintf(message + pos, " %s", *argv),
126 pos = len; 126 pos = len;
127 } while (*++argv); 127 } while (*++argv);