error return value already indicated that errno was set. Also, we might
as well accept any error or junk remaining in the field as a parse error.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95743
13f79535-47bb-0310-9956-
ffa450edef68
if (*pos == '\0') {
char *endstr;
+
+ errno = 0;
ctx->state = BODY_LENGTH;
ctx->remaining = strtol(lenp, &endstr, 10);
- if (errno == ERANGE) {
+ if (errno || (endstr && *endstr)) {
conversion_error = 1;
}
}
if (*pos == '\0') {
char *endstr;
+
+ errno = 0;
r->remaining = strtol(lenp, &endstr, 10);
- if (errno == ERANGE || errno == EINVAL) {
+ if (errno || (endstr && *endstr)) {
conversion_error = 1;
}
}