提交 1bb2daea 编写于 作者: R Rich Salz

Simplify parse_yesno; remove local variable

Reviewed-by: NTim Hudson <tjh@openssl.org>
上级 bc2f5803
...@@ -1803,7 +1803,6 @@ void free_index(CA_DB *db) ...@@ -1803,7 +1803,6 @@ void free_index(CA_DB *db)
int parse_yesno(const char *str, int def) int parse_yesno(const char *str, int def)
{ {
int ret = def;
if (str) { if (str) {
switch (*str) { switch (*str) {
case 'f': /* false */ case 'f': /* false */
...@@ -1811,21 +1810,16 @@ int parse_yesno(const char *str, int def) ...@@ -1811,21 +1810,16 @@ int parse_yesno(const char *str, int def)
case 'n': /* no */ case 'n': /* no */
case 'N': /* NO */ case 'N': /* NO */
case '0': /* 0 */ case '0': /* 0 */
ret = 0; return 0;
break;
case 't': /* true */ case 't': /* true */
case 'T': /* TRUE */ case 'T': /* TRUE */
case 'y': /* yes */ case 'y': /* yes */
case 'Y': /* YES */ case 'Y': /* YES */
case '1': /* 1 */ case '1': /* 1 */
ret = 1; return 1;
break;
default:
ret = def;
break;
} }
} }
return ret; return def;
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册