exit(0);
}
-
int (*test_function_table[])(void) = {
test_vpnsvc_init,
test_vpnsvc_deinit,
TEST_CONSOLE_INPUT(input, 3);
unsigned int comm = strtoul(input, NULL, 0);
- if (comm <= 0 || comm > (sizeof(test_function_table) / sizeof(int))) {
+ if ((comm == ULONG_MAX && errno == ERANGE) || comm <= 0
+ || comm >= sizeof(test_function_table)/sizeof(*test_function_table)) {
if (input[0] == 'q') {
test_exit();
return 0;
continue;
}
- int rv = test_function_table[comm-1]();
+ int rv = test_function_table[comm - 1]();
if (rv == 1)
printf("Operation succeeded!\n");
else