diff --git a/src/set.cpp b/src/set.cpp index bda5c51248..253e9118d3 100644 --- a/src/set.cpp +++ b/src/set.cpp @@ -1351,17 +1351,10 @@ void Set::topology(int keyword) /* ---------------------------------------------------------------------- */ -void Set::varparse(char *name, int m) +void Set::varparse(const char *name, int m) { varflag = 1; - - name = &name[2]; - int n = strlen(name) + 1; - char *str = new char[n]; - strcpy(str,name); - - int ivar = input->variable->find(str); - delete [] str; + int ivar = input->variable->find(name+2); if (ivar < 0) error->all(FLERR,"Variable name for set command does not exist"); diff --git a/src/set.h b/src/set.h index 6788849677..29f1ea526e 100644 --- a/src/set.h +++ b/src/set.h @@ -48,7 +48,7 @@ class Set : protected Pointers { void set(int); void setrandom(int); void topology(int); - void varparse(char *, int); + void varparse(const char *, int); }; }