Some implementations of strtol(), like the one in musl, will
return EINVAL in errno when no valid number was found in
the string.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
errno = 0;
id = strtol(argv[1], &name, 10);
errno = 0;
id = strtol(argv[1], &name, 10);
- if (id == 0 && errno == 0) {
+ if (id == 0 && (errno == 0 || errno == EINVAL)) {
ret = del_output(UINT32_MAX, name);
} else if (errno == 0 && *name == '\0') {
ret = del_output(id, NULL);
ret = del_output(UINT32_MAX, name);
} else if (errno == 0 && *name == '\0') {
ret = del_output(id, NULL);