From 278eeb14eec5c3d2d8b7f0ee49c61a24b18900ce Mon Sep 17 00:00:00 2001 From: sjplimp Date: Tue, 15 Feb 2011 18:33:43 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@5640 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/fix_store_state.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/fix_store_state.cpp b/src/fix_store_state.cpp index 9eda88e1ef..fada7e953b 100644 --- a/src/fix_store_state.cpp +++ b/src/fix_store_state.cpp @@ -407,7 +407,9 @@ void FixStoreState::end_of_step() // fill vector or array with per-atom values - buf = &values[0][0]; + if (values) buf = &values[0][0]; + else buf = NULL; + for (int m = 0; m < nvalues; m++) { if (which[m] == KEYWORD && kflag) (this->*pack_choice[m])(m); @@ -485,8 +487,10 @@ void FixStoreState::grow_arrays(int nmax) { values = memory->grow_2d_double_array(values,nmax,nvalues, "fix_store:values"); - if (nvalues == 0) vector_atom = &values[0][0]; - else array_atom = values; + if (nvalues == 0) { + if (nmax) vector_atom = &values[0][0]; + else vector_atom = NULL; + } else array_atom = values; } /* ----------------------------------------------------------------------