mirror of
https://github.com/espressif/openthread.git
synced 2026-09-05 08:40:06 +00:00
[posix] print error and exit when node id is invalid (#2429)
This commit is contained in:
@@ -77,7 +77,7 @@ void PlatformInit(int argc, char *argv[])
|
||||
|
||||
NODE_ID = (uint32_t)strtol(argv[1], &endptr, 0);
|
||||
|
||||
if (*endptr != '\0')
|
||||
if (*endptr != '\0' || NODE_ID < 1 || NODE_ID >= WELLKNOWN_NODE_ID)
|
||||
{
|
||||
fprintf(stderr, "Invalid NODE_ID: %s\n", argv[1]);
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
Reference in New Issue
Block a user