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) {