diff --git a/test/nsoption.c b/test/nsoption.c index de0530e8d..76cfeaf0b 100644 --- a/test/nsoption.c +++ b/test/nsoption.c @@ -615,8 +615,6 @@ END_TEST START_TEST(nsoption_api_snoptionf_param_test) { int ret; - ret = nsoption_snoptionf(NULL, 0, -1, ""); - ck_assert_int_eq(ret, -1); ret = nsoption_snoptionf(NULL, 0, NSOPTION_LISTEND, ""); ck_assert_int_eq(ret, -1); diff --git a/utils/nsoption.c b/utils/nsoption.c index 6754d2131..92ecfc176 100644 --- a/utils/nsoption.c +++ b/utils/nsoption.c @@ -826,7 +826,7 @@ nsoption_snoptionf(char *string, return -1; } - if ((option_idx < 0) || (option_idx >= NSOPTION_LISTEND)) { + if (option_idx >= NSOPTION_LISTEND) { return -1; }