silence compiler warnings, avoid integer or buffer overflows

This commit is contained in:
Axel Kohlmeyer
2022-10-05 10:52:17 -04:00
parent 7fa020e574
commit 80da4c307c
4 changed files with 23 additions and 30 deletions

View File

@ -165,7 +165,7 @@ TEST_F(LAMMPS_extract_variable, format)
{
f_lammps_setup_extract_variable();
int i;
char str[10];
char str[16];
char *fstr;
for (i = 1; i <= 10; i++) {
std::sprintf(str, "%.6G", std::exp(i));
@ -180,7 +180,7 @@ TEST_F(LAMMPS_extract_variable, format_pad)
{
f_lammps_setup_extract_variable();
int i;
char str[10];
char str[16];
char *fstr;
for (i = 1; i <= 10; i++) {
std::sprintf(str, "%08.6G", std::exp(i));