diff options
Diffstat (limited to 'log.c')
-rw-r--r-- | log.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -34,7 +34,7 @@ | |||
34 | */ | 34 | */ |
35 | 35 | ||
36 | #include "includes.h" | 36 | #include "includes.h" |
37 | RCSID("$OpenBSD: log.c,v 1.24 2002/07/19 15:43:33 markus Exp $"); | 37 | RCSID("$OpenBSD: log.c,v 1.25 2003/01/11 18:29:43 markus Exp $"); |
38 | 38 | ||
39 | #include "log.h" | 39 | #include "log.h" |
40 | #include "xmalloc.h" | 40 | #include "xmalloc.h" |
@@ -234,6 +234,7 @@ fatal_remove_all_cleanups(void) | |||
234 | next_cu = cu->next; | 234 | next_cu = cu->next; |
235 | xfree(cu); | 235 | xfree(cu); |
236 | } | 236 | } |
237 | fatal_cleanups = NULL; | ||
237 | } | 238 | } |
238 | 239 | ||
239 | /* Cleanup and exit */ | 240 | /* Cleanup and exit */ |
@@ -388,11 +389,14 @@ do_log(LogLevel level, const char *fmt, va_list args) | |||
388 | } else { | 389 | } else { |
389 | vsnprintf(msgbuf, sizeof(msgbuf), fmt, args); | 390 | vsnprintf(msgbuf, sizeof(msgbuf), fmt, args); |
390 | } | 391 | } |
392 | /* Escape magic chars in output. */ | ||
393 | strnvis(fmtbuf, msgbuf, sizeof(fmtbuf), VIS_OCTAL); | ||
394 | |||
391 | if (log_on_stderr) { | 395 | if (log_on_stderr) { |
392 | fprintf(stderr, "%s\r\n", msgbuf); | 396 | fprintf(stderr, "%s\r\n", fmtbuf); |
393 | } else { | 397 | } else { |
394 | openlog(argv0 ? argv0 : __progname, LOG_PID, log_facility); | 398 | openlog(argv0 ? argv0 : __progname, LOG_PID, log_facility); |
395 | syslog(pri, "%.500s", msgbuf); | 399 | syslog(pri, "%.500s", fmtbuf); |
396 | closelog(); | 400 | closelog(); |
397 | } | 401 | } |
398 | } | 402 | } |