chiark / gitweb /
svc/conntrack.in (straddr): Handle `None' as a packed address.
[tripe] / client / tripectl.c
index f818de8d8c91f8a2fb765e9e709907825109675e..95f95f44ba5ba07c5e95375200a4322056764f43 100644 (file)
@@ -52,6 +52,7 @@
 #include <mLib/daemonize.h>
 #include <mLib/darray.h>
 #include <mLib/dstr.h>
+#include <mLib/macros.h>
 #include <mLib/mdup.h>
 #include <mLib/mdwopt.h>
 #include <mLib/quis.h>
@@ -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;