more replacing of sprintf() with snprintf()

This commit is contained in:
Axel Kohlmeyer
2018-09-06 10:45:48 -04:00
parent 4d52cb9245
commit 9c27548a5c
67 changed files with 168 additions and 185 deletions

View File

@ -86,7 +86,7 @@ FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) :
FILE *fpr_2 = force->open_potential(arg[4]);
if (fpr_2 == NULL) {
char str[128];
sprintf(str,"Cannot open file %s",arg[4]);
snprintf(str,128,"Cannot open file %s",arg[4]);
error->all(FLERR,str);
}
@ -99,7 +99,7 @@ FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) :
FILE *fpr = force->open_potential(arg[8]);
if (fpr == NULL) {
char str[128];
sprintf(str,"Cannot open file %s",arg[8]);
snprintf(str,128,"Cannot open file %s",arg[8]);
error->all(FLERR,str);
}
@ -111,7 +111,7 @@ FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) :
fp = fopen(arg[10],"w");
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open fix ttm/mod file %s",arg[10]);
snprintf(str,128,"Cannot open fix ttm/mod file %s",arg[10]);
error->one(FLERR,str);
}
}