diff options
author | Eric Andersen <andersen@codepoet.org> | 2000-12-08 22:35:51 +0300 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2000-12-08 22:35:51 +0300 |
commit | 9cff4fbac91bdd63acbed23b732d76c56177ca62 (patch) | |
tree | aa6dac97487324c215bea690e8ad73c99e0c487c /sysklogd/logger.c | |
parent | 5e09b6e3a83c83fe3db99ef9f8b2cdf6dc21cec4 (diff) |
Patch from Matt Kraai to make logger log all arguments.
Diffstat (limited to 'sysklogd/logger.c')
-rw-r--r-- | sysklogd/logger.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sysklogd/logger.c b/sysklogd/logger.c index 1ed6dc639..1c454e5af 100644 --- a/sysklogd/logger.c +++ b/sysklogd/logger.c @@ -149,10 +149,19 @@ extern int logger_main(int argc, char **argv) } message = buf; } else { - if (argc >= 1) - message = *argv; - else + if (argc >= 1) { + int len = 1; /* for the '\0' */ + for (; *argv != NULL; argv++) { + len += strlen(*argv); + len += 1; /* for the space between the args */ + message = xrealloc(message, len); + strcat(message, *argv); + strcat(message, " "); + } + message[strlen(message)-1] = '\0'; + } else { error_msg_and_die("No message\n"); + } } openlog(name, option, (pri | LOG_FACMASK)); |