]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
xmltv: handle timezone attached to time with no space padding
authordhead666 <myfoolishgames@gmail.com>
Tue, 1 Sep 2015 14:15:16 +0000 (17:15 +0300)
committerJaroslav Kysela <perex@perex.cz>
Tue, 8 Sep 2015 12:51:36 +0000 (14:51 +0200)
src/epggrab/module/xmltv.c

index 00f55815602b105081938f6fc02b5a3c49d22cfd..886c1bb8dde03147e309c124a72f3c4aa6929490 100644 (file)
@@ -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;
   }