use snprintf() in a bunch of cases to avoid overflowing fixed size buffers with unchecked strings

This commit is contained in:
Axel Kohlmeyer
2018-09-06 02:57:53 -04:00
parent 0b951840f2
commit ca04e8f31c
16 changed files with 40 additions and 38 deletions

View File

@ -1632,7 +1632,7 @@ void Molecule::open(char *file)
fp = fopen(file,"r");
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open molecule file %s",file);
snprintf(str,128,"Cannot open molecule file %s",file);
error->one(FLERR,str);
}
}