1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Fixed an ISO8601 time parsing bug

This commit is contained in:
tpoole 2017-07-19 14:46:08 +01:00
parent a5c404a155
commit 60b4b7cfe5

View file

@ -506,7 +506,19 @@ Time Time::fromISO8601 (StringRef iso) noexcept
if (minutes < 0)
return {};
milliseconds = (int) (1000.0 * CharacterFunctions::readDoubleValue (t));
auto seconds = parseFixedSizeIntAndSkip (t, 2, 0);
if (seconds < 0)
return {};
if (*t == '.')
{
++t;
milliseconds = parseFixedSizeIntAndSkip (t, 3, 0);
if (milliseconds < 0)
return {};
}
milliseconds += 1000 * seconds;
}
const juce_wchar nextChar = t.getAndAdvance();