From 51eaabe27adb82f7ab4b49fe214fd35ab2a031ec Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Sun, 6 Mar 2016 22:08:04 -0800 Subject: [PATCH] Format attributes go in the header, and I are dumb. --- adsbus/exec.c | 4 ++-- adsbus/log.c | 1 - adsbus/log.h | 3 ++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/adsbus/exec.c b/adsbus/exec.c index 90fa5d3..55d8647 100644 --- a/adsbus/exec.c +++ b/adsbus/exec.c @@ -91,12 +91,12 @@ static void exec_log_handler(struct peer *peer) { while ((eol = memchr(iter, '\n', len))) { assert(eol >= iter); size_t linelen = (size_t) (eol - iter); - log_write('E', exec->id, "(child output) %.*s", linelen, iter); + log_write('E', exec->id, "(child output) %.*s", (int) linelen, iter); iter += (linelen + 1); len -= (linelen + 1); } if (len) { - log_write('E', exec->id, "(child output) %.*s", len, iter); + log_write('E', exec->id, "(child output) %.*s", (int) len, iter); } } diff --git a/adsbus/log.c b/adsbus/log.c index 1b48144..1671a97 100644 --- a/adsbus/log.c +++ b/adsbus/log.c @@ -19,7 +19,6 @@ void log_cleanup() { assert(!fclose(log_stream)); } -__attribute__ ((__format__ (__printf__, 3, 4))) void log_write(char type, const uint8_t *id, const char *fmt, ...) { va_list ap; va_start(ap, fmt); diff --git a/adsbus/log.h b/adsbus/log.h index 536ff5d..a0d20f5 100644 --- a/adsbus/log.h +++ b/adsbus/log.h @@ -4,4 +4,5 @@ void log_init(void); void log_cleanup(void); -void log_write(char, const uint8_t *, const char *, ...); +void log_write(char, const uint8_t *, const char *, ...) + __attribute__ ((__format__ (__printf__, 3, 4)));