regedit: Fix format-nonliteral warning
authorAmitay Isaacs <amitay@gmail.com>
Mon, 8 Aug 2016 04:21:14 +0000 (14:21 +1000)
committerJeremy Allison <jra@samba.org>
Tue, 23 Aug 2016 23:33:50 +0000 (01:33 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12168

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/utils/regedit.c
source3/utils/regedit_dialog.c
source3/utils/regedit_dialog.h

index 9db63b9e443e7f74d0446be23474d77d196efcfe..83b09b423446084daedc4866c40d74a24fd8707e 100644 (file)
@@ -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;
index 07fb1909c0f0897e89341bc30eea90cfe6a686fb..21ec96ccca6cc581c5f9b38a948095b0bce75c6a 100644 (file)
@@ -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,
index 5c7c84a3d118beff627d2a5f0b1a7e1463df04f8..b8bc3bfb035dc9ff7ee02e37b049b6dbd82bec11 100644 (file)
@@ -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;