diff options
author | Jochen Dolze <vdr@dolze.de> | 2012-04-04 13:05:15 +0200 |
---|---|---|
committer | Jochen Dolze <vdr@dolze.de> | 2012-04-04 13:05:15 +0200 |
commit | 4d5bfc7c68db5776711b21fbcef70d02f22b5789 (patch) | |
tree | 07c2cde08530a8a48dcc79f7342528e7c7c231dc /dist | |
parent | 3033eb15a2e29abe3e30ed89a44179069e0b06a2 (diff) | |
download | vdr-plugin-xmltv2vdr-4d5bfc7c68db5776711b21fbcef70d02f22b5789.tar.gz vdr-plugin-xmltv2vdr-4d5bfc7c68db5776711b21fbcef70d02f22b5789.tar.bz2 |
Added cppcheck 1.53 suggestions
Diffstat (limited to 'dist')
-rw-r--r-- | dist/epgdata2xmltv/epgdata2xmltv.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/dist/epgdata2xmltv/epgdata2xmltv.cpp b/dist/epgdata2xmltv/epgdata2xmltv.cpp index fcef073..b463274 100644 --- a/dist/epgdata2xmltv/epgdata2xmltv.cpp +++ b/dist/epgdata2xmltv/epgdata2xmltv.cpp @@ -115,7 +115,7 @@ int cepgdata2xmltv::DownloadData(const char *url) curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 0); // don't follow redirects curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, WriteMemoryCallback); // Send all data to this function curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *) &data); // Pass our 'data' struct to the callback function - curl_easy_setopt(curl_handle, CURLOPT_MAXFILESIZE, 45971520); // Set maximum file size to get (bytes) + curl_easy_setopt(curl_handle, CURLOPT_MAXFILESIZE, 85971520); // Set maximum file size to get (bytes) curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1); // No progress meter curl_easy_setopt(curl_handle, CURLOPT_NOSIGNAL, 1); // No signaling curl_easy_setopt(curl_handle, CURLOPT_TIMEOUT, 240); // Set timeout to 240 seconds @@ -247,8 +247,19 @@ int cepgdata2xmltv::Process(int argc, char *argv[]) } char *line=NULL,*lptr=NULL; size_t size; - getline(&line,&size,f); - getline(&line,&size,f); + if (getline(&line,&size,f)==(ssize_t) -1) + { + fclose(f); + esyslog("failed to read epgdata2xmltv config"); + return 1; + } + if (getline(&line,&size,f)==(ssize_t) -1) + { + fclose(f); + if (line) free(line); + esyslog("failed to read epgdata2xmltv config"); + return 1; + } char *sc=strchr(line,';'); if (sc) { |