replaced sprintf -> snprintf throughout.
This commit is contained in:
@@ -103,7 +103,7 @@ PMuppStartupHandler::PMuppStartupHandler()
|
||||
// check if the startup file is found under $HOME/.musrfit/mupp
|
||||
home = getenv("HOME");
|
||||
if (home != 0) {
|
||||
sprintf(startup_path_name, "%s/.musrfit/mupp/mupp_startup.xml", home);
|
||||
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit/mupp/mupp_startup.xml", home);
|
||||
if (StartupFileExists(startup_path_name)) {
|
||||
fStartupFilePath = TString(startup_path_name);
|
||||
fStartupFileFound = true;
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace mupp
|
||||
Iterator line_start = get_pos(err_pos, line);
|
||||
const char *homeStr = getenv("HOME");
|
||||
char fln[1024];
|
||||
sprintf(fln, "%s/.musrfit/mupp/mupp_err.log", homeStr);
|
||||
snprintf(fln, sizeof(fln), "%s/.musrfit/mupp/mupp_err.log", homeStr);
|
||||
std::ofstream fout(fln, std::ofstream::app);
|
||||
if (err_pos != last) {
|
||||
fout << message << what << ':' << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user