IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Opened 21 years ago

Closed 21 years ago

Last modified 20 years ago

#600 closed defect (fixed)

psTimeFromISO fails to parse an ISO time

Reported by: Paul Price Owned by: David.Robbins@…
Priority: high Milestone:
Component: astro Version: 0.8.0
Severity: normal Keywords:
Cc:

Description

Attempting to parse a valid ISO time results in:

2005:11:23 18:01:46Z|mithrandir |E|psTimeFromISO (psTime.c:1375)

Specified ISO Time string, '2005-11-23T12:34:56.789', is malformed. Must be

in 'YYYY-MM-DDThh:mm:ss.sss' format.

This is due to the following snippet in psTime.c:

Convert YYYY-MM-DDThh:mm:ss.sss in string form to tm time
if (sscanf(input, "%d-%d-%dT%d:%d:%d,%d", &tmTime.tm_year, &tmTime.tm_mon,

&tmTime.tm_mday,

&tmTime.tm_hour, &tmTime.tm_min, &tmTime.tm_sec,&millisecond) < 7) {

psError(PS_ERR_BAD_PARAMETER_VALUE, true,

PS_ERRORTEXT_psTime_ISOTIME_MALFORMED, input);

return NULL;

}

Note the presence of a comma in the sscanf format, which should be a decimal
point (this despite the comment line above).

The string testTime1Str in tst_psTime_01.c which is used to test psTimeFromISO
also contains a comma, which causes the test to pass.

Change History (6)

comment:1 by Paul Price, 21 years ago

Identified the comma in the SDRS and fixed it.

Note also that fractions of a second are optional, and are not always included
in an ISO time.

comment:2 by robert.desonia@…, 21 years ago

Status: newassigned

comment:3 by robert.desonia@…, 21 years ago

Owner: changed from robert.desonia@… to David.Robbins@…
Status: assignednew

comment:4 by David.Robbins@…, 21 years ago

Resolution: fixed
Status: newclosed

replaced the comma with a period

comment:5 by Paul Price, 20 years ago

Keywords: VERIFIED added

Bug has been resolved.... closing.

comment:6 by Paul Price, 20 years ago

Keywords: VERIFIED removed

Bugs have been fixed... closing.

Note: See TracTickets for help on using tickets.