mirror of
https://github.com/openssl/openssl.git
synced 2024-11-24 02:23:51 +08:00
Simplify parse_yesno; remove local variable
Reviewed-by: Tim Hudson <tjh@openssl.org>
This commit is contained in:
parent
bc2f5803cc
commit
1bb2daead8
12
apps/apps.c
12
apps/apps.c
@ -1803,7 +1803,6 @@ void free_index(CA_DB *db)
|
||||
|
||||
int parse_yesno(const char *str, int def)
|
||||
{
|
||||
int ret = def;
|
||||
if (str) {
|
||||
switch (*str) {
|
||||
case 'f': /* false */
|
||||
@ -1811,21 +1810,16 @@ int parse_yesno(const char *str, int def)
|
||||
case 'n': /* no */
|
||||
case 'N': /* NO */
|
||||
case '0': /* 0 */
|
||||
ret = 0;
|
||||
break;
|
||||
return 0;
|
||||
case 't': /* true */
|
||||
case 'T': /* TRUE */
|
||||
case 'y': /* yes */
|
||||
case 'Y': /* YES */
|
||||
case '1': /* 1 */
|
||||
ret = 1;
|
||||
break;
|
||||
default:
|
||||
ret = def;
|
||||
break;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
return def;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user