mirror of
https://git.busybox.net/busybox.git
synced 2024-11-24 06:03:27 +08:00
Logger forgot to NULL terminate strings from stdin.
This commit is contained in:
parent
58a408512b
commit
5e8b3ea19d
2
logger.c
2
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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user