From: dhead666 Date: Tue, 1 Sep 2015 14:15:16 +0000 (+0300) Subject: xmltv: handle timezone attached to time with no space padding X-Git-Tag: v4.0.6~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d8bd6fb019cfd17f80bac30f0e313d4e944969ae;p=thirdparty%2Ftvheadend.git xmltv: handle timezone attached to time with no space padding --- diff --git a/src/epggrab/module/xmltv.c b/src/epggrab/module/xmltv.c index 00f558156..886c1bb8d 100644 --- a/src/epggrab/module/xmltv.c +++ b/src/epggrab/module/xmltv.c @@ -72,13 +72,15 @@ static time_t _xmltv_str2time(const char *in) str[sizeof(str)-1] = '\0'; /* split tz */ - while (str[sp] && str[sp] != ' ') + while (str[sp] && str[sp] != ' ' && str[sp] != '+' && str[sp] != '-') + sp++; + if (str[sp] == ' ') sp++; /* parse tz */ // TODO: handle string TZ? if (str[sp]) { - sscanf(str+sp+1, "%d", &tz); + sscanf(str+sp, "%d", &tz); tz = (tz % 100) + (tz / 100) * 3600; // Convert from HHMM to seconds str[sp] = 0; }