gtp_echo_responder: report invalid chars present in node-feautres cmdline arg as error
from "man strtoul":
"""
If endptr is not NULL, strtoul() stores the address of the first invalid character in *endptr.
In particular, if *nptr is not '\0' but **endptr is '\0' on return, the entire string is valid.
"""
Fixes: ae81195418
Change-Id: I89d26a575ef81ee17483db035924354588d9d094
This commit is contained in:
parent
ae81195418
commit
8cbdd21867
|
@ -125,7 +125,7 @@ static uint8_t parse_node_features_mask(const char *arg)
|
|||
|
||||
res = strtoul(arg, &end, 0);
|
||||
if ((errno == ERANGE && res == ULONG_MAX) || (errno && !res) ||
|
||||
arg == end) {
|
||||
arg == end || *end != '\0') {
|
||||
fprintf(stderr, "Failed parsing Node Features bitmask: '%s'\n", arg);
|
||||
exit(1);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue