From 5855b039ddedd39a81eaf419d771b32e02668cd3 Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Mon, 8 Aug 2016 14:21:14 +1000 Subject: [PATCH] regedit: Fix format-nonliteral warning BUG: https://bugzilla.samba.org/show_bug.cgi?id=12168 Signed-off-by: Amitay Isaacs Reviewed-by: Andreas Schneider Reviewed-by: Jeremy Allison --- source3/utils/regedit.c | 2 +- source3/utils/regedit_dialog.c | 6 ++++++ source3/utils/regedit_dialog.h | 18 ++++++++++++------ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/source3/utils/regedit.c b/source3/utils/regedit.c index 9db63b9e443..83b09b42344 100644 --- a/source3/utils/regedit.c +++ b/source3/utils/regedit.c @@ -157,7 +157,7 @@ static void add_reg_key(struct regedit *regedit, struct tree_node *node, if (subkey) { msg = "Enter name of new subkey"; } - dialog_input(regedit, &name, "New Key", msg); + dialog_input(regedit, &name, "New Key", "%s", msg); if (name) { WERROR rv; struct registry_key *new_key; diff --git a/source3/utils/regedit_dialog.c b/source3/utils/regedit_dialog.c index 07fb1909c0f..21ec96ccca6 100644 --- a/source3/utils/regedit_dialog.c +++ b/source3/utils/regedit_dialog.c @@ -1758,6 +1758,12 @@ static bool input_on_submit(struct dialog *dia, struct dialog_section *section, return true; } +static int dialog_input_internal(TALLOC_CTX *ctx, void *output, + enum input_type type, + const char *title, + const char *msg, va_list ap) + PRINTF_ATTRIBUTE(5,0); + static int dialog_input_internal(TALLOC_CTX *ctx, void *output, enum input_type type, const char *title, diff --git a/source3/utils/regedit_dialog.h b/source3/utils/regedit_dialog.h index 5c7c84a3d11..b8bc3bfb035 100644 --- a/source3/utils/regedit_dialog.h +++ b/source3/utils/regedit_dialog.h @@ -147,9 +147,12 @@ void dialog_modal_loop(struct dialog *dia, WERROR *err, enum dialog_action *action); struct dialog_section *dialog_section_label_new_va(TALLOC_CTX *ctx, - const char *msg, va_list ap); + const char *msg, + va_list ap) + PRINTF_ATTRIBUTE(2,0); struct dialog_section *dialog_section_label_new(TALLOC_CTX *ctx, - const char *msg, ...); + const char *msg, ...) + PRINTF_ATTRIBUTE(2,3); struct dialog_section *dialog_section_hsep_new(TALLOC_CTX *ctx, int sep); @@ -208,14 +211,17 @@ enum dialog_type { }; int dialog_notice(TALLOC_CTX *ctx, enum dialog_type type, - const char *title, const char *msg, ...); + const char *title, const char *msg, ...) + PRINTF_ATTRIBUTE(4,5); int dialog_input(TALLOC_CTX *ctx, const char **output, const char *title, - const char *msg, ...); + const char *msg, ...) PRINTF_ATTRIBUTE(4,5); int dialog_input_long(TALLOC_CTX *ctx, long *output, - const char *title, const char *msg, ...); + const char *title, const char *msg, ...) + PRINTF_ATTRIBUTE(4,5); int dialog_input_ulong(TALLOC_CTX *ctx, unsigned long *output, - const char *title, const char *msg, ...); + const char *title, const char *msg, ...) + PRINTF_ATTRIBUTE(4,5); struct registry_key; struct value_item;