Simplify parse_yesno; remove local variable

Reviewed-by: Tim Hudson <tjh@openssl.org>
This commit is contained in:
Rich Salz 2015-04-26 21:28:38 -04:00
parent bc2f5803cc
commit 1bb2daead8

View File

@ -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;
}
/*