diff options
author | beck <> | 2014-07-13 16:03:10 +0000 |
---|---|---|
committer | beck <> | 2014-07-13 16:03:10 +0000 |
commit | 6e4dfa23733fddf37830d1039cf31a2ffb86bdaf (patch) | |
tree | c2bbb8405534dcf838bc686b6748045284f3966b /src/lib/libcrypto/ui/ui_lib.c | |
parent | 143b41eb184dd7da7b6f74162483016fbb5faab0 (diff) | |
download | openbsd-6e4dfa23733fddf37830d1039cf31a2ffb86bdaf.tar.gz openbsd-6e4dfa23733fddf37830d1039cf31a2ffb86bdaf.tar.bz2 openbsd-6e4dfa23733fddf37830d1039cf31a2ffb86bdaf.zip |
The bell tolls for BUF_strdup - Start the migration to using
intrinsics. This is the easy ones, a few left to check one at
a time.
ok miod@ deraadt@
Diffstat (limited to 'src/lib/libcrypto/ui/ui_lib.c')
-rw-r--r-- | src/lib/libcrypto/ui/ui_lib.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/libcrypto/ui/ui_lib.c b/src/lib/libcrypto/ui/ui_lib.c index a33484c72b..4fabcd9909 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.26 2014/07/11 16:22:29 deraadt Exp $ */ | 1 | /* $OpenBSD: ui_lib.c,v 1.27 2014/07/13 16:03:10 beck 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 | */ |
@@ -245,7 +245,7 @@ UI_dup_input_string(UI *ui, const char *prompt, int flags, char *result_buf, | |||
245 | char *prompt_copy = NULL; | 245 | char *prompt_copy = NULL; |
246 | 246 | ||
247 | if (prompt) { | 247 | if (prompt) { |
248 | prompt_copy = BUF_strdup(prompt); | 248 | prompt_copy = strdup(prompt); |
249 | if (prompt_copy == NULL) { | 249 | if (prompt_copy == NULL) { |
250 | UIerr(UI_F_UI_DUP_INPUT_STRING, ERR_R_MALLOC_FAILURE); | 250 | UIerr(UI_F_UI_DUP_INPUT_STRING, ERR_R_MALLOC_FAILURE); |
251 | return 0; | 251 | return 0; |
@@ -270,7 +270,7 @@ UI_dup_verify_string(UI *ui, const char *prompt, int flags, | |||
270 | char *prompt_copy = NULL; | 270 | char *prompt_copy = NULL; |
271 | 271 | ||
272 | if (prompt) { | 272 | if (prompt) { |
273 | prompt_copy = BUF_strdup(prompt); | 273 | prompt_copy = strdup(prompt); |
274 | if (prompt_copy == NULL) { | 274 | if (prompt_copy == NULL) { |
275 | UIerr(UI_F_UI_DUP_VERIFY_STRING, ERR_R_MALLOC_FAILURE); | 275 | UIerr(UI_F_UI_DUP_VERIFY_STRING, ERR_R_MALLOC_FAILURE); |
276 | return -1; | 276 | return -1; |
@@ -298,28 +298,28 @@ UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc, | |||
298 | char *cancel_chars_copy = NULL; | 298 | char *cancel_chars_copy = NULL; |
299 | 299 | ||
300 | if (prompt) { | 300 | if (prompt) { |
301 | prompt_copy = BUF_strdup(prompt); | 301 | prompt_copy = strdup(prompt); |
302 | if (prompt_copy == NULL) { | 302 | if (prompt_copy == NULL) { |
303 | UIerr(UI_F_UI_DUP_INPUT_BOOLEAN, ERR_R_MALLOC_FAILURE); | 303 | UIerr(UI_F_UI_DUP_INPUT_BOOLEAN, ERR_R_MALLOC_FAILURE); |
304 | goto err; | 304 | goto err; |
305 | } | 305 | } |
306 | } | 306 | } |
307 | if (action_desc) { | 307 | if (action_desc) { |
308 | action_desc_copy = BUF_strdup(action_desc); | 308 | action_desc_copy = strdup(action_desc); |
309 | if (action_desc_copy == NULL) { | 309 | if (action_desc_copy == NULL) { |
310 | UIerr(UI_F_UI_DUP_INPUT_BOOLEAN, ERR_R_MALLOC_FAILURE); | 310 | UIerr(UI_F_UI_DUP_INPUT_BOOLEAN, ERR_R_MALLOC_FAILURE); |
311 | goto err; | 311 | goto err; |
312 | } | 312 | } |
313 | } | 313 | } |
314 | if (ok_chars) { | 314 | if (ok_chars) { |
315 | ok_chars_copy = BUF_strdup(ok_chars); | 315 | ok_chars_copy = strdup(ok_chars); |
316 | if (ok_chars_copy == NULL) { | 316 | if (ok_chars_copy == NULL) { |
317 | UIerr(UI_F_UI_DUP_INPUT_BOOLEAN, ERR_R_MALLOC_FAILURE); | 317 | UIerr(UI_F_UI_DUP_INPUT_BOOLEAN, ERR_R_MALLOC_FAILURE); |
318 | goto err; | 318 | goto err; |
319 | } | 319 | } |
320 | } | 320 | } |
321 | if (cancel_chars) { | 321 | if (cancel_chars) { |
322 | cancel_chars_copy = BUF_strdup(cancel_chars); | 322 | cancel_chars_copy = strdup(cancel_chars); |
323 | if (cancel_chars_copy == NULL) { | 323 | if (cancel_chars_copy == NULL) { |
324 | UIerr(UI_F_UI_DUP_INPUT_BOOLEAN, ERR_R_MALLOC_FAILURE); | 324 | UIerr(UI_F_UI_DUP_INPUT_BOOLEAN, ERR_R_MALLOC_FAILURE); |
325 | goto err; | 325 | goto err; |
@@ -350,7 +350,7 @@ UI_dup_info_string(UI *ui, const char *text) | |||
350 | char *text_copy = NULL; | 350 | char *text_copy = NULL; |
351 | 351 | ||
352 | if (text) { | 352 | if (text) { |
353 | text_copy = BUF_strdup(text); | 353 | text_copy = strdup(text); |
354 | if (text_copy == NULL) { | 354 | if (text_copy == NULL) { |
355 | UIerr(UI_F_UI_DUP_INFO_STRING, ERR_R_MALLOC_FAILURE); | 355 | UIerr(UI_F_UI_DUP_INFO_STRING, ERR_R_MALLOC_FAILURE); |
356 | return -1; | 356 | return -1; |
@@ -373,7 +373,7 @@ UI_dup_error_string(UI *ui, const char *text) | |||
373 | char *text_copy = NULL; | 373 | char *text_copy = NULL; |
374 | 374 | ||
375 | if (text) { | 375 | if (text) { |
376 | text_copy = BUF_strdup(text); | 376 | text_copy = strdup(text); |
377 | if (text_copy == NULL) { | 377 | if (text_copy == NULL) { |
378 | UIerr(UI_F_UI_DUP_ERROR_STRING, ERR_R_MALLOC_FAILURE); | 378 | UIerr(UI_F_UI_DUP_ERROR_STRING, ERR_R_MALLOC_FAILURE); |
379 | return -1; | 379 | return -1; |