properly initialize Atom class member and avoid side effects during write data

This commit is contained in:
Axel Kohlmeyer
2022-09-11 22:11:22 -04:00
parent 34714dba29
commit ed0af32fce
3 changed files with 6 additions and 1 deletions

View File

@ -73,7 +73,8 @@ void WriteData::command(int narg, char **arg)
coeffflag = 1;
fixflag = 1;
lmapflag = 1;
atom->types_style = Atom::NUMERIC;
// store current (default) setting since we may change it.
int types_style = atom->types_style;
int noinit = 0;
int iarg = 1;
@ -134,6 +135,8 @@ void WriteData::command(int narg, char **arg)
}
write(file);
// restore saved setting
atom->types_style = types_style;
}
/* ----------------------------------------------------------------------