fix compile warnings from previous commit

warning: declaration of ‘url’ shadows a previous local
warning: the use of `tmpnam' is dangerous


Origin commit data
------------------
Branch: ni/coolstream
Commit: 788b0ad1e8
Author: vanhofen <vanhofen@gmx.de>
Date: 2018-09-01 (Sat, 01 Sep 2018)

Origin message was:
------------------
- fix compile warnings from previous commit

warning: declaration of ‘url’ shadows a previous local
warning: the use of `tmpnam' is dangerous


------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2018-09-01 14:34:24 +02:00
parent 1e1e448ade
commit b559e60e7d

View File

@@ -840,21 +840,24 @@ void CBouquetManager::loadWebchannels(int mode)
for (std::list<std::string>::iterator it = webchannels_xml->begin(); it != webchannels_xml->end(); ++it) for (std::list<std::string>::iterator it = webchannels_xml->begin(); it != webchannels_xml->end(); ++it)
{ {
std::string url = (*it); std::string filename = (*it);
std::string tmp_name = tmpnam (NULL); std::string extension = getFileExt(filename);
std::string extension = getFileExt(url);
std::string tmp_name = "/tmp/.webchannel";
tmp_name = tmp_name + "." + extension; tmp_name = tmp_name + "." + extension;
bool remove_tmp = false; bool remove_tmp = false;
if (url.compare(0,1,"/") == 0) if (filename.compare(0, 1, "/") == 0)
tmp_name = url; tmp_name = filename;
else { else
if (::downloadUrl(url,tmp_name)) {
remove_tmp = true;} if (::downloadUrl(filename, tmp_name))
remove_tmp = true;
}
if (!access(tmp_name.c_str(), R_OK)) if (!access(tmp_name.c_str(), R_OK))
{ {
INFO("Loading %s from %s ...", (mode == MODE_WEBTV) ? "webtv" : "webradio", url.c_str()); INFO("Loading %s from %s ...", (mode == MODE_WEBTV) ? "webtv" : "webradio", filename.c_str());
// check for extension // check for extension
bool e2tv = false; bool e2tv = false;