diff --git a/src/group.cpp b/src/group.cpp index 00677cca5a..765fe4d85d 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -99,6 +99,7 @@ void Group::assign(int narg, char **arg) // clear mask of each atom assigned to this group if (strcmp(arg[1],"delete") == 0) { + if (narg != 2) error->all(FLERR,"Illegal group command"); int igroup = find(arg[0]); if (igroup == -1) error->all(FLERR,"Could not find group delete group ID"); if (igroup == 0) error->all(FLERR,"Cannot delete group all"); @@ -183,7 +184,8 @@ void Group::assign(int narg, char **arg) } else if (strcmp(arg[1],"empty") == 0) { - ; // nothing to do here + if (narg != 2) error->all(FLERR,"Illegal group command"); + // nothing else to do here // style = type, molecule, id // add to group if atom matches type/molecule/id or condition @@ -546,7 +548,7 @@ void Group::assign(const std::string &groupcmd) add flagged atoms to a new or existing group ------------------------------------------------------------------------- */ -void Group::create(char *name, int *flag) +void Group::create(const char *name, int *flag) { int i; diff --git a/src/group.h b/src/group.h index 39c446d119..0c5a18384c 100644 --- a/src/group.h +++ b/src/group.h @@ -32,7 +32,7 @@ class Group : protected Pointers { ~Group(); void assign(int, char **); // assign atoms to a group void assign(const std::string &); // convenience function - void create(char *, int *); // add flagged atoms to a group + void create(const char *, int *); // add flagged atoms to a group int find(const std::string &); // lookup name in list of groups int find_or_create(const char *); // lookup name or create new group void write_restart(FILE *);