diff options
author | 2014-10-03 06:02:38 +0000 | |
---|---|---|
committer | 2014-10-03 06:02:38 +0000 | |
commit | dda2f39b88970f7a1011e2c8eeb552ff52fe78d8 (patch) | |
tree | a7cb7e2503b912e6743aca2bbae442a20727d5fb /lib/libcrypto/ui/ui_lib.c | |
parent | if you're adding the first cluster reference, you dont have to (diff) | |
download | wireguard-openbsd-dda2f39b88970f7a1011e2c8eeb552ff52fe78d8.tar.xz wireguard-openbsd-dda2f39b88970f7a1011e2c8eeb552ff52fe78d8.zip |
Use string literals in printf style calls so gcc's -Wformat works.
ok tedu@, miod@
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; } |