Skip to content
Snippets Groups Projects
Commit ef450258 authored by Luis Kornblueh's avatar Luis Kornblueh
Browse files

Fix problem with strtol and errno.

parent a10f004e
No related branches found
No related tags found
No related merge requests found
......@@ -110,14 +110,15 @@ date_machine( char *str, ISO8601_STATUS* stat, struct internal_datetime* dtObj,
_year[0] = '-';
char *end;
dtObj->year = strtol(_year,&end, 10);
dtObj->year = strtol(_year, &end, 10);
//TODO on LUIS: Should we have similar range checks on duration long strings now that we support arbitrariry strigs like PT1000202S?
/* Year might be too large. */
if ((errno == ERANGE) || (dtObj->year > YEAR_UPPER_BOUND) || (dtObj->year < YEAR_LOWER_BOUND))
{
RAISE_YEAR_OUT_OF_BOUND_EXCEPTION = true;
}
if (end == _year)
if ((errno == ERANGE) || (dtObj->year > YEAR_UPPER_BOUND) || (dtObj->year < YEAR_LOWER_BOUND))
{
RAISE_YEAR_OUT_OF_BOUND_EXCEPTION = true;
}
}
action year_month_copy
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment