avoid segmentation fault, when creating a LAMMPS instance from the library interface. arg[] may be NULL.
This commit is contained in:
@ -89,7 +89,8 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
|
||||
|
||||
suffix = suffix2 = NULL;
|
||||
suffix_enable = 0;
|
||||
exename = arg[0];
|
||||
if (arg) exename = arg[0];
|
||||
else exename = (const char *)"(LAMMPS)";
|
||||
packargs = NULL;
|
||||
num_package = 0;
|
||||
char *rfile = NULL;
|
||||
|
||||
Reference in New Issue
Block a user