more buffer overflow avoiding through using snprintf()

This commit is contained in:
Axel Kohlmeyer
2018-09-06 09:57:43 -04:00
parent fbc1c1cfdd
commit 4d52cb9245
9 changed files with 26 additions and 26 deletions

View File

@ -183,7 +183,7 @@ void WriteData::write(char *file)
fp = fopen(file,"w");
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open data file %s",file);
snprintf(str,128,"Cannot open data file %s",file);
error->one(FLERR,str);
}
}