avoid segmentation fault, when creating a LAMMPS instance from the library interface. arg[] may be NULL.

This commit is contained in:
Axel Kohlmeyer
2016-11-10 13:28:32 -05:00
parent 352e177fcd
commit 2b75ee761d

View File

@ -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;