29 Aug
2003
29 Aug
'03
10:52 p.m.
I was trying to use the date_time ptime functions with ISO syle input (boost 1.30.2 with MSVC++6 SP5). The function parse_undelimited_time_duration in time_parsing has three short variables hours, min, and sec that are uninitialized which lead to unpredictable results. These are at line 99. I stumbled on to this when I passed a string "20011027T0202" to ptime(from_iso_string()). To my surprise when I printed the value out it came back as 20011026T222345! The code works OK as is if you always pass a full HHMMSS. This must have been found in parse_delimited_time_duration as it has unsigned shorts that are intialized to zero.