From b559e60e7d96b23787b6aba4bd5e20340a416f7c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 1 Sep 2018 14:34:24 +0200 Subject: [PATCH] fix compile warnings from previous commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit warning: declaration of ‘url’ shadows a previous local warning: the use of `tmpnam' is dangerous Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/788b0ad1e8870e81a9c3d0db1f8c8f6ed1373e68 Author: vanhofen 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 --- src/zapit/src/bouquets.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/zapit/src/bouquets.cpp b/src/zapit/src/bouquets.cpp index a8d3a7ad1..66a88098f 100644 --- a/src/zapit/src/bouquets.cpp +++ b/src/zapit/src/bouquets.cpp @@ -840,21 +840,24 @@ void CBouquetManager::loadWebchannels(int mode) for (std::list::iterator it = webchannels_xml->begin(); it != webchannels_xml->end(); ++it) { - std::string url = (*it); - std::string tmp_name = tmpnam (NULL); - std::string extension = getFileExt(url); + std::string filename = (*it); + std::string extension = getFileExt(filename); + + std::string tmp_name = "/tmp/.webchannel"; tmp_name = tmp_name + "." + extension; bool remove_tmp = false; - if (url.compare(0,1,"/") == 0) - tmp_name = url; - else { - if (::downloadUrl(url,tmp_name)) - remove_tmp = true;} + if (filename.compare(0, 1, "/") == 0) + tmp_name = filename; + else + { + if (::downloadUrl(filename, tmp_name)) + remove_tmp = true; + } 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 bool e2tv = false;