diff --git a/examples/watchdog/watchdog_main.c b/examples/watchdog/watchdog_main.c index 95ff07b83..aeff559dd 100644 --- a/examples/watchdog/watchdog_main.c +++ b/examples/watchdog/watchdog_main.c @@ -95,9 +95,9 @@ static void wdog_help(void) printf("timer. Ping for the watchdog for seconds, then let it expire.\n"); printf("\nOptions include:\n"); printf(" [-d ] = Selects the time in milliseconds. Default: %d\n", - CONFIG_EXAMPLES_WATCHDOG_PINGTIME); - printf(" [-p 99) + if (value < 1 || value > INT_MAX) { printf("Ping time out of range: %ld\n", value); exit(EXIT_FAILURE); } - wdog->pingtime = (uint8_t)value; + wdog->pingtime = (uint32_t)value; index += nargs; break;