use snprintf() in a bunch of cases to avoid overflowing fixed size buffers with unchecked strings
This commit is contained in:
@ -937,7 +937,7 @@ void FixAveHisto::options(int iarg, int narg, char **arg)
|
||||
fp = fopen(arg[iarg+1],"w");
|
||||
if (fp == NULL) {
|
||||
char str[128];
|
||||
sprintf(str,"Cannot open fix ave/histo file %s",arg[iarg+1]);
|
||||
snprintf(str,128,"Cannot open fix ave/histo file %s",arg[iarg+1]);
|
||||
error->one(FLERR,str);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user