From ca8ecfd93ccdc7f4f6fcdcb0763737ae521a950d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 12 Jan 2018 11:31:55 +0100 Subject: [PATCH] update: fix check for installed version; equivalent to 13ecef5 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3a4e207aaadf132b60eafd414ca8112c5625c007 Author: vanhofen Date: 2018-01-12 (Fri, 12 Jan 2018) Origin message was: ------------------ - update: fix check for installed version; equivalent to 13ecef5 --- src/gui/update.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/update.cpp b/src/gui/update.cpp index 266edd898..4de35477e 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -167,11 +167,13 @@ bool CFlashUpdate::checkOnlineVersion() std::vector update_t_list; CConfigFile _configfile('\t'); - const char * versionString = (_configfile.loadConfig(TARGET_PREFIX "/.version")) ? (_configfile.getString( "version", "????????????????").c_str()) : "????????????????"; + std::string versionString = "????????????????"; + if (_configfile.loadConfig(TARGET_PREFIX "/.version")) + versionString = _configfile.getString("version", "????????????????"); dprintf(DEBUG_NORMAL, "[update] file %s\n", g_settings.softupdate_url_file.c_str()); - CFlashVersionInfo curInfo(versionString); + CFlashVersionInfo curInfo(versionString.c_str()); curVer = curInfo.getVersion(); - dprintf(DEBUG_NORMAL, "[update] current flash-version: %s (%d) date %s (%ld)\n", versionString, curInfo.getVersion(), curInfo.getDate(), curInfo.getDateTime()); + dprintf(DEBUG_NORMAL, "[update] current flash-version: %s (%d) date %s (%ld)\n", versionString.c_str(), curInfo.getVersion(), curInfo.getDate(), curInfo.getDateTime()); std::ifstream urlFile(g_settings.softupdate_url_file.c_str()); if (urlFile >> url) {