From 212d8954dd553c08d1d89b4cadcd568a309a8049 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Thu, 6 Dec 2012 23:48:51 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@9146 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- tools/restart2data.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/restart2data.cpp b/tools/restart2data.cpp index 910fccf6fe..e2324db429 100644 --- a/tools/restart2data.cpp +++ b/tools/restart2data.cpp @@ -606,6 +606,7 @@ void header(FILE *fp, Data &data) char *substyle; for (int i = 1; i <= nwords; i++) { substyle = read_char(fp); + strip_suffix(substyle); set_style(substyle,data,i); } } @@ -699,8 +700,10 @@ void groups(FILE *fp) int count = 0; for (int i = 0; i < MAX_GROUP; i++) { name = read_char(fp); - delete [] name; - count++; + if (name) { + delete [] name; + count++; + } if (count == ngroup) break; } } @@ -2623,6 +2626,7 @@ void pair(FILE *fp, Data &data, char *style, int flag) int nstyles = read_int(fp); for (int i = 0; i < nstyles; i++) { char *substyle = read_char(fp); + strip_suffix(substyle); pair(fp,data,substyle,0); }