more buffer overflow avoiding through using snprintf()
This commit is contained in:
@ -362,7 +362,7 @@ void PairTable::read_table(Table *tb, char *file, char *keyword)
|
||||
FILE *fp = force->open_potential(file);
|
||||
if (fp == NULL) {
|
||||
char str[128];
|
||||
sprintf(str,"Cannot open file %s",file);
|
||||
snprintf(str,128,"Cannot open file %s",file);
|
||||
error->one(FLERR,str);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user