diff --git a/src/USER-NETCDF/dump_netcdf.cpp b/src/USER-NETCDF/dump_netcdf.cpp index a50e01ce95..e1a8dfab69 100644 --- a/src/USER-NETCDF/dump_netcdf.cpp +++ b/src/USER-NETCDF/dump_netcdf.cpp @@ -183,7 +183,7 @@ DumpNetCDF::DumpNetCDF(LAMMPS *lmp, int narg, char **arg) : for (int j = 0; j < DUMP_NC_MAX_DIMS; j++) { perat[inc].field[j] = -1; } - strcpy(perat[inc].name, mangled); + strncpy(perat[inc].name, mangled, NC_FIELD_NAME_MAX); n_perat++; } diff --git a/src/integrate.cpp b/src/integrate.cpp index 7fc74c5db2..7d4bf36929 100644 --- a/src/integrate.cpp +++ b/src/integrate.cpp @@ -23,7 +23,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -Integrate::Integrate(LAMMPS *lmp, int /*narg*/, char **/*arg*/) : Pointers(lmp) +Integrate::Integrate(LAMMPS *lmp, int /*narg*/, char ** /*arg*/) : Pointers(lmp) { elist_global = elist_atom = nullptr; vlist_global = vlist_atom = cvlist_atom = nullptr; diff --git a/src/library.cpp b/src/library.cpp index 2fd1486bc2..074cb3cffa 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -1976,7 +1976,7 @@ void lammps_gather_atoms(void *handle, char *name, int type, int count, void *da // use atom ID to insert each atom's values into copy // MPI_Allreduce with MPI_SUM to merge into data, ordered by atom ID - if (type == LAMMPS_INT) { + if (type == 0) { int *vector = nullptr; int **array = nullptr; const int imgunpack = (count == 3) && (strcmp(name,"image") == 0); @@ -2015,7 +2015,7 @@ void lammps_gather_atoms(void *handle, char *name, int type, int count, void *da MPI_Allreduce(copy,data,count*natoms,MPI_INT,MPI_SUM,lmp->world); lmp->memory->destroy(copy); - } else if (type == LAMMPS_DOUBLE) { + } else if (type == 1) { double *vector = nullptr; double **array = nullptr; if (count == 1) vector = (double *) vptr; diff --git a/src/update.cpp b/src/update.cpp index eebebb91be..a8a698a7f3 100644 --- a/src/update.cpp +++ b/src/update.cpp @@ -323,7 +323,12 @@ void Update::create_integrate(int narg, char **arg, int trysuffix) delete integrate; int sflag; - new_integrate(arg[0],narg-1,&arg[1],trysuffix,sflag); + + if(narg-1 > 0) { + new_integrate(arg[0],narg-1,&arg[1],trysuffix,sflag); + } else { + new_integrate(arg[0],0,nullptr,trysuffix,sflag); + } std::string estyle = arg[0]; if (sflag) {