From 333fccef85246b4dee2c44e9ff76da4c7f45d81c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 16 Sep 2017 14:04:06 +0200 Subject: [PATCH] setting_helpers: fix flagfile handling in CFlagFileNotifier() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/57bdeba6369345b276e4799eb326523c67b2748b Author: vanhofen Date: 2017-09-16 (Sat, 16 Sep 2017) Origin message was: ------------------ - setting_helpers: fix flagfile handling in CFlagFileNotifier() ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/system/setting_helpers.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index 4a749457a..eb576484f 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -140,13 +140,14 @@ bool CTouchFileNotifier::changeNotify(const neutrino_locale_t, void * data) bool CFlagFileNotifier::changeNotify(const neutrino_locale_t, void * data) { std::ostringstream buf; + buf.str(""); buf << FLAGDIR << "/." << filename; - const char *flagfile = buf.str().c_str(); + std::string flagfile = buf.str(); if ((*(int *)data) != 0) { - FILE * fd = fopen(flagfile, "w"); + FILE * fd = fopen(flagfile.c_str(), "w"); if (fd) { fclose(fd); @@ -243,7 +244,7 @@ bool CFlagFileNotifier::changeNotify(const neutrino_locale_t, void * data) if (my_system(3, "service", filename, "stop") != 0) printf("[CFlagFileNotifier] executing failed\n"); } - remove(flagfile); + remove(flagfile.c_str()); } return menu_return::RETURN_REPAINT; }