use snprintf() in a bunch of cases to avoid overflowing fixed size buffers with unchecked strings
This commit is contained in:
@ -78,7 +78,7 @@ void FixEnforce2D::init()
|
||||
flist[nfixlist++] = modify->fix[i];
|
||||
else {
|
||||
char msg[256];
|
||||
sprintf(msg,"Fix enforce2d must be defined after fix %s",modify->fix[i]->style);
|
||||
snprintf(msg,256,"Fix enforce2d must be defined after fix %s",modify->fix[i]->style);
|
||||
error->all(FLERR,msg);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user