From 546c9a109ebdf7ec280bea8985e03faede042107 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 18 Aug 2021 20:25:49 -0400 Subject: [PATCH] fix uninitialized data bug --- src/fix_property_atom.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fix_property_atom.cpp b/src/fix_property_atom.cpp index 2d122e9b03..0744aca7b2 100644 --- a/src/fix_property_atom.cpp +++ b/src/fix_property_atom.cpp @@ -93,11 +93,12 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) : } else if (utils::strmatch(arg[iarg],"^i_")) { style[nvalue] = IVEC; - int flag,cols; - index[nvalue] = atom->find_custom(&arg[iarg][2],flag,cols); + int flag,ncols; + index[nvalue] = atom->find_custom(&arg[iarg][2],flag,ncols); if (index[nvalue] >= 0) error->all(FLERR,"Fix property/atom vector name already exists"); index[nvalue] = atom->add_custom(&arg[iarg][2],0,0); + cols[nvalue] = 0; nvalue++; iarg++; @@ -108,6 +109,7 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) : if (index[nvalue] >= 0) error->all(FLERR,"Fix property/atom vector name already exists"); index[nvalue] = atom->add_custom(&arg[iarg][2],1,0); + cols[nvalue] = 0; nvalue++; iarg++;