diff options
author | Jochen Dolze <vdr@dolze.de> | 2012-04-07 16:55:39 +0200 |
---|---|---|
committer | Jochen Dolze <vdr@dolze.de> | 2012-04-07 16:55:39 +0200 |
commit | 11d34a334a55b98950634be3612ed78eece8407d (patch) | |
tree | 48ec4082255ac2d87808e61db268e33240f9771f /parse.cpp | |
parent | 4d5bfc7c68db5776711b21fbcef70d02f22b5789 (diff) | |
download | vdr-plugin-xmltv2vdr-11d34a334a55b98950634be3612ed78eece8407d.tar.gz vdr-plugin-xmltv2vdr-11d34a334a55b98950634be3612ed78eece8407d.tar.bz2 |
Fixed execution check
Cosmetics and more (debug) output
Diffstat (limited to 'parse.cpp')
-rw-r--r-- | parse.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
@@ -99,10 +99,19 @@ time_t cParse::ConvertXMLTVTime2UnixTime(char *xmltvtime) void cParse::RemoveNonAlphaNumeric(char *String) { if (!String) return; + + // remove " Teil " int len=strlen(String); - char *p=String; - int pos=0; + char *p=strstr(String," Teil "); + if (p) + { + memmove(p,p+6,len-6); + } + // remove non alphanumeric characters + len=strlen(String); + p=String; + int pos=0; while (*p) { // 0x30 - 0x39 @@ -135,6 +144,7 @@ void cParse::RemoveNonAlphaNumeric(char *String) break; } } + return; } @@ -143,6 +153,8 @@ bool cParse::FetchSeasonEpisode(iconv_t Conv, const char *EPDir, const char *Tit { if (!EPDir) return false; if (!ShortText) return false; + size_t slen=strlen(ShortText); + if (!slen) return false; if (!Title) return false; if (Conv==(iconv_t) -1) return false; @@ -176,7 +188,6 @@ bool cParse::FetchSeasonEpisode(iconv_t Conv, const char *EPDir, const char *Tit return false; } - size_t slen=strlen(ShortText); size_t dlen=4*slen; char *dshorttext=(char *) calloc(dlen,1); if (!dshorttext) @@ -197,7 +208,13 @@ bool cParse::FetchSeasonEpisode(iconv_t Conv, const char *EPDir, const char *Tit } RemoveNonAlphaNumeric(dshorttext); - + if (!strlen(dshorttext)) + { + free(dshorttext); + fclose(f); + free(epfile); + return false; + } char *line=NULL; size_t length; |