Skip to content

Commit

Permalink
Use correct format strings for signed integers
Browse files Browse the repository at this point in the history
  • Loading branch information
practicalswift authored and rustyrussell committed Mar 26, 2018
1 parent 74f3662 commit 94ca824
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions common/subdaemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ 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;
}

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)
Expand Down
2 changes: 1 addition & 1 deletion lightningd/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 94ca824

Please sign in to comment.