From c997125e8d01b797a5ea991eee48f913d5e1b2a6 Mon Sep 17 00:00:00 2001 From: Chris Frey Date: Sun, 15 Aug 2010 22:12:21 -0400 Subject: [PATCH] lib: fixed bug in ISO timezone detection Must be in [-+]HH[:]MM format, with 2 digits for the hours and minutes --- ChangeLog | 3 +++ src/tzwrapper.cc | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 41e6acd9..7b039fd1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,9 @@ Release: version 0.17 - 2010/01/?? that have separate libraries for these features, such as the Mac - buildgen.sh calls libtoolize and glibtoolize now (Mac support) +2010/08/15 + - lib: fixed bug in ISO timezone detection... must be in [-+]HH[:]MM + format, with 2 digits for the hours and minutes 2010/08/12 - lib: added better ISO timestamp support... Now handles timestamps with dashes and colons, including timestamps with their diff --git a/src/tzwrapper.cc b/src/tzwrapper.cc index 4bb0be6d..6c312bed 100644 --- a/src/tzwrapper.cc +++ b/src/tzwrapper.cc @@ -111,7 +111,7 @@ struct tm* iso_to_tm(const char *timestamp, int hour, min; found = sscanf(offset.c_str(), "%02d%02d", &hour, &min); - if( found == 2 ) { + if( offset.size() == 4 && found == 2 ) { *zone = true; *zoneminutes = hour * 60 + min; if( neg != string::npos ) -- 2.11.4.GIT