summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniele Di Proietto <diproiettod@vmware.com>2015-05-06 19:00:24 +0100
committerBen Pfaff <blp@nicira.com>2015-05-07 12:49:38 -0700
commit7521b9e59e7e70773f542e748823cb2236b8c462 (patch)
treee0309bbd3d52853264dd920887b34c597b30104e /lib
parent881ac34c52da07ef4c0825f92629cb6362813410 (diff)
downloadopenvswitch-7521b9e59e7e70773f542e748823cb2236b8c462.tar.gz
dpctl: Add OVS_PRINTF_FORMAT annotation to dpctl_* functions.
Fixes passing variable data as a printf() format string. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/dpctl.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/dpctl.c b/lib/dpctl.c
index a9a56ff81..0f21a5130 100644
--- a/lib/dpctl.c
+++ b/lib/dpctl.c
@@ -60,6 +60,11 @@ struct dpctl_command {
dpctl_command_handler *handler;
};
static const struct dpctl_command *get_all_dpctl_commands(void);
+static void dpctl_print(struct dpctl_params *dpctl_p, const char *fmt, ...)
+ OVS_PRINTF_FORMAT(2, 3);
+static void dpctl_error(struct dpctl_params* dpctl_p, int err_no,
+ const char *fmt, ...)
+ OVS_PRINTF_FORMAT(3, 4);
static void
dpctl_puts(struct dpctl_params *dpctl_p, bool error, const char *string)
@@ -402,7 +407,7 @@ dpctl_set_if(int argc, const char *argv[], struct dpctl_params *dpctl_p)
char *err_s = NULL;
error = netdev_set_config(netdev, &args, &err_s);
if (err_s || error) {
- dpctl_error(dpctl_p, error,
+ dpctl_error(dpctl_p, error, "%s",
err_s ? err_s : "Error updating configuration");
free(err_s);
}
@@ -1477,7 +1482,7 @@ dpctl_normalize_actions(int argc, const char *argv[],
ds_clear(&s);
format_odp_actions(&s, af->actions.data, af->actions.size);
- dpctl_print(dpctl_p, ds_cstr(&s));
+ dpctl_puts(dpctl_p, false, ds_cstr(&s));
ofpbuf_uninit(&af->actions);
free(af);