bugfix: returning pointer to local variable, char* to string in function definition

This commit is contained in:
2018-02-07 10:14:52 +01:00
parent 618f6291cf
commit ecf1e9fac1
6 changed files with 11 additions and 11 deletions

View File

@ -524,13 +524,13 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
/**
returns currently the loaded trimfile/settingsfile name
*/
const char *getSettingsFile(){\
string getSettingsFile(){\
string s(thisDetector->settingsFile); \
if (s.length()>6) {\
if (s.substr(s.length()-6,3)==string(".sn") && s.substr(s.length()-3)!=string("xxx") ) \
return s.substr(0,s.length()-6).c_str(); \
return s.substr(0,s.length()-6); \
} \
return thisDetector->settingsFile;\
return string(thisDetector->settingsFile);\
};