projects
/
platform
/
upstream
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d24d5c8
)
logger: fix a problem of losing all argv except first
author
Denis Vlasenko
<vda.linux@googlemail.com>
Tue, 2 Oct 2007 09:57:41 +0000
(09:57 -0000)
committer
Denis Vlasenko
<vda.linux@googlemail.com>
Tue, 2 Oct 2007 09:57:41 +0000
(09:57 -0000)
sysklogd/logger.c
patch
|
blob
|
history
diff --git
a/sysklogd/logger.c
b/sysklogd/logger.c
index
df5d8ff
..
6e1debd
100644
(file)
--- a/
sysklogd/logger.c
+++ b/
sysklogd/logger.c
@@
-107,7
+107,7
@@
int logger_main(int argc, char **argv)
argv += optind;
if (!argc) {
#define strbuf bb_common_bufsiz1
argv += optind;
if (!argc) {
#define strbuf bb_common_bufsiz1
- while (fgets(strbuf,
BUFSIZ
, stdin)) {
+ while (fgets(strbuf,
COMMON_BUFSIZE
, stdin)) {
if (strbuf[0]
&& NOT_LONE_CHAR(strbuf, '\n')
) {
if (strbuf[0]
&& NOT_LONE_CHAR(strbuf, '\n')
) {
@@
-117,11
+117,11
@@
int logger_main(int argc, char **argv)
}
} else {
char *message = NULL;
}
} else {
char *message = NULL;
- int len =
1; /* for NUL */
+ int len =
0;
int pos = 0;
do {
len += strlen(*argv) + 1;
int pos = 0;
do {
len += strlen(*argv) + 1;
- message = xrealloc(message, len);
+ message = xrealloc(message, len
+ 1
);
sprintf(message + pos, " %s", *argv),
pos = len;
} while (*++argv);
sprintf(message + pos, " %s", *argv),
pos = len;
} while (*++argv);