diff options
Diffstat (limited to 'lib/libcrypto/ui/ui_lib.c')
-rw-r--r-- | lib/libcrypto/ui/ui_lib.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/libcrypto/ui/ui_lib.c b/lib/libcrypto/ui/ui_lib.c index baf86d7635b..2c53f534e7c 100644 --- a/lib/libcrypto/ui/ui_lib.c +++ b/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; } |