We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9f35c6a commit 5e4d567Copy full SHA for 5e4d567
src/util.c
@@ -120,7 +120,7 @@ str_to_uint(const char *str, unsigned int *out)
120
errno = 0;
121
value = strtoul(str, &str_endp, 0);
122
123
- if (errno != 0 || str == str_endp || *str_endp != '\0') {
+ if (errno != 0 || str == str_endp || (*str_endp != '\0' && *str_endp != '\n')) {
124
return EINVAL;
125
}
126
@@ -141,7 +141,7 @@ str_to_int(const char *str, int *out)
141
142
value = strtol(str, &str_endp, 0);
143
144
145
146
147
0 commit comments