X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/tripe/blobdiff_plain/0dba5cb9b3471c0205ef50705d6632910fdf16fa..c3897a7de7a53dab3f96fb224fa90dd35fa56dc1:/client/tripectl.c?ds=sidebyside diff --git a/client/tripectl.c b/client/tripectl.c index f818de8d..95f95f44 100644 --- a/client/tripectl.c +++ b/client/tripectl.c @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -65,7 +66,6 @@ #include "util.h" #undef sun -#define IGNORE(x) do if (x); while (0) /*----- Data structures ---------------------------------------------------*/ @@ -123,7 +123,7 @@ static void checkbg(char **p) die(EXIT_FAILURE, "unexpected background tag `%s'", q); } -static void dolog(int prio, const char *msg, ...) +static void PRINTF_LIKE(2, 3) dolog(int prio, const char *msg, ...) { va_list ap; dstr d = DSTR_INIT; @@ -163,9 +163,9 @@ static void cline(char *p, size_t len, void *b) if (!q) return; if (strcmp(q, "WARN") == 0) - dolog(LOG_WARNING, p); + dolog(LOG_WARNING, "%s", p); else if (strcmp(q, "TRACE") == 0) - dolog(LOG_DEBUG, p); + dolog(LOG_DEBUG, "%s", p); else if (!(f & f_command)) dolog(LOG_ERR, "unexpected output `%s %s'", q, p); else if (strcmp(q, "FAIL") == 0) { @@ -285,7 +285,7 @@ static void logfile(const char *name) if (logfp) writelog("error", d.buf); else if (logname) - die(EXIT_FAILURE, d.buf); + die(EXIT_FAILURE, "%s", d.buf); if (f & f_syslog) syslog(LOG_ERR, "%s", d.buf); dstr_destroy(&d); @@ -299,7 +299,7 @@ static void cleanup(void) { if (pidfile) unlink(pidfile); } static void sigdie(int sig) { cleanup(); signal(sig, SIG_DFL); raise(sig); } -static void putarg(string_v *av, const char *fmt, ...) +static void PRINTF_LIKE(2, 3) putarg(string_v *av, const char *fmt, ...) { va_list ap; dstr d = DSTR_INIT;