helpers: fix warning in neutrinoMode_to_string();

cc1plus: warning: function may return address of local variable [-Wreturn-local-addr]
../src/system/helpers.cpp:114:16: note: declared here
 std::string res = s.str();
  ^~~


Origin commit data
------------------
Commit: 86e0ee951d
Author: vanhofen <vanhofen@gmx.de>
Date: 2022-04-18 (Mon, 18 Apr 2022)

Origin message was:
------------------
- helpers: fix warning in neutrinoMode_to_string();

cc1plus: warning: function may return address of local variable [-Wreturn-local-addr]
../src/system/helpers.cpp:114:16: note: declared here
  std::string res = s.str();
        ^~~
This commit is contained in:
vanhofen
2022-04-18 20:10:54 +02:00
parent 1133bd061a
commit ba2cc578d7

View File

@@ -111,8 +111,7 @@ const char* neutrinoMode_to_string(int mode)
return "NO_REZAP";
default:
s << std::hex << mode;
std::string res = s.str();
return res.c_str();
return s.str().c_str();
}
}