From 079e384e3438a23d2ddc504f4d34e5a46d9dd6e8 Mon Sep 17 00:00:00 2001 From: doug <> Date: Fri, 3 Oct 2014 06:02:38 +0000 Subject: Use string literals in printf style calls so gcc's -Wformat works. ok tedu@, miod@ --- src/lib/libcrypto/ui/ui_lib.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/lib/libcrypto/ui/ui_lib.c') diff --git a/src/lib/libcrypto/ui/ui_lib.c b/src/lib/libcrypto/ui/ui_lib.c index baf86d7635..2c53f534e7 100644 --- a/src/lib/libcrypto/ui/ui_lib.c +++ b/src/lib/libcrypto/ui/ui_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ui_lib.c,v 1.28 2014/07/22 02:21:20 beck Exp $ */ +/* $OpenBSD: ui_lib.c,v 1.29 2014/10/03 06:02:38 doug Exp $ */ /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL * project 2001. */ @@ -386,7 +386,6 @@ UI_dup_error_string(UI *ui, const char *text) char * UI_construct_prompt(UI *ui, const char *object_desc, const char *object_name) { - const char *format = "Enter %s for %s:"; char *prompt; if (ui->meth->ui_construct_prompt) @@ -395,10 +394,15 @@ UI_construct_prompt(UI *ui, const char *object_desc, const char *object_name) if (object_desc == NULL) return NULL; - if (object_name == NULL) - format = "Enter %s:"; - if (asprintf(&prompt, format, object_desc, object_name) == -1) - return NULL; + + if (object_name == NULL) { + if (asprintf(&prompt, "Enter %s:", object_desc) == -1) + return (NULL); + } else { + if (asprintf(&prompt, "Enter %s for %s:", object_desc, + object_name) == -1) + return (NULL); + } return prompt; } -- cgit v1.2.3-55-g6feb