core files: replace sprintf with snprintf

This commit is contained in:
Richard Berger
2024-07-13 15:33:56 -06:00
parent 993a7cce54
commit 58513320d3
8 changed files with 53 additions and 44 deletions

View File

@ -1025,7 +1025,7 @@ char *Variable::retrieve(const char *name)
error->all(FLERR, "Variable {}: format variable {} has incompatible style",
names[ivar],data[ivar][0]);
double answer = compute_equal(jvar);
sprintf(data[ivar][2],data[ivar][1],answer);
snprintf(data[ivar][2],VALUELENGTH,data[ivar][1],answer);
str = data[ivar][2];
} else if (style[ivar] == GETENV) {