summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ui/ui_lib.c
diff options
context:
space:
mode:
authordoug <>2014-10-03 06:02:38 +0000
committerdoug <>2014-10-03 06:02:38 +0000
commit079e384e3438a23d2ddc504f4d34e5a46d9dd6e8 (patch)
treeec58ae0912470726cdc0183e7bc10028ba918120 /src/lib/libcrypto/ui/ui_lib.c
parent8b25549254bce5b7fc083b5930f89878aa04174f (diff)
downloadopenbsd-079e384e3438a23d2ddc504f4d34e5a46d9dd6e8.tar.gz
openbsd-079e384e3438a23d2ddc504f4d34e5a46d9dd6e8.tar.bz2
openbsd-079e384e3438a23d2ddc504f4d34e5a46d9dd6e8.zip
Use string literals in printf style calls so gcc's -Wformat works.
ok tedu@, miod@
Diffstat (limited to 'src/lib/libcrypto/ui/ui_lib.c')
-rw-r--r--src/lib/libcrypto/ui/ui_lib.c16
1 files changed, 10 insertions, 6 deletions
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 @@
1/* $OpenBSD: ui_lib.c,v 1.28 2014/07/22 02:21:20 beck Exp $ */ 1/* $OpenBSD: ui_lib.c,v 1.29 2014/10/03 06:02:38 doug Exp $ */
2/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL 2/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
3 * project 2001. 3 * project 2001.
4 */ 4 */
@@ -386,7 +386,6 @@ UI_dup_error_string(UI *ui, const char *text)
386char * 386char *
387UI_construct_prompt(UI *ui, const char *object_desc, const char *object_name) 387UI_construct_prompt(UI *ui, const char *object_desc, const char *object_name)
388{ 388{
389 const char *format = "Enter %s for %s:";
390 char *prompt; 389 char *prompt;
391 390
392 if (ui->meth->ui_construct_prompt) 391 if (ui->meth->ui_construct_prompt)
@@ -395,10 +394,15 @@ UI_construct_prompt(UI *ui, const char *object_desc, const char *object_name)
395 394
396 if (object_desc == NULL) 395 if (object_desc == NULL)
397 return NULL; 396 return NULL;
398 if (object_name == NULL) 397
399 format = "Enter %s:"; 398 if (object_name == NULL) {
400 if (asprintf(&prompt, format, object_desc, object_name) == -1) 399 if (asprintf(&prompt, "Enter %s:", object_desc) == -1)
401 return NULL; 400 return (NULL);
401 } else {
402 if (asprintf(&prompt, "Enter %s for %s:", object_desc,
403 object_name) == -1)
404 return (NULL);
405 }
402 406
403 return prompt; 407 return prompt;
404} 408}