From 94ca824cf547273bc57ced135555102a242f1329 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Sun, 25 Mar 2018 22:01:54 +0200 Subject: [PATCH] Use correct format strings for signed integers --- common/subdaemon.c | 8 ++++---- lightningd/log.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/subdaemon.c b/common/subdaemon.c index 4a9733e7f468..b3d6564bb6b1 100644 --- a/common/subdaemon.c +++ b/common/subdaemon.c @@ -20,9 +20,9 @@ static int backtrace_status(void *unused UNUSED, uintptr_t pc, const char *filename, int lineno, const char *function) { - fprintf(stderr, "backtrace: %s:%u (%s) %p\n", + fprintf(stderr, "backtrace: %s:%d (%s) %p\n", filename, lineno, function, (void *)pc); - status_trace("backtrace: %s:%u (%s) %p", + status_trace("backtrace: %s:%d (%s) %p", filename, lineno, function, (void *)pc); return 0; } @@ -30,12 +30,12 @@ static int backtrace_status(void *unused UNUSED, uintptr_t pc, static void crashdump(int sig) { /* We do stderr first, since it's most reliable. */ - warnx("Fatal signal %u", sig); + warnx("Fatal signal %d", sig); backtrace_print(backtrace_state, 0, stderr); /* Now send to parent. */ backtrace_full(backtrace_state, 0, backtrace_status, NULL, NULL); - status_failed(STATUS_FAIL_INTERNAL_ERROR, "FATAL SIGNAL %u", sig); + status_failed(STATUS_FAIL_INTERNAL_ERROR, "FATAL SIGNAL %d", sig); } static void crashlog_activate(void) diff --git a/lightningd/log.c b/lightningd/log.c index aacc3921d4ab..5bb82e8f2f54 100644 --- a/lightningd/log.c +++ b/lightningd/log.c @@ -515,7 +515,7 @@ static void log_crash(int sig) } if (sig) { - fprintf(stderr, "Fatal signal %u. ", sig); + fprintf(stderr, "Fatal signal %d. ", sig); if (backtrace_state) backtrace_print(backtrace_state, 0, stderr); }