Format attributes go in the header, and I are dumb.

This commit is contained in:
Ian Gulliver
2016-03-06 22:08:04 -08:00
parent ca754a817e
commit 51eaabe27a
3 changed files with 4 additions and 4 deletions

View File

@@ -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);
}
}

View File

@@ -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);

View File

@@ -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)));