diff --git a/lib/gpu/lal_device.cpp b/lib/gpu/lal_device.cpp index 98175efe72..9dbd02dd3e 100644 --- a/lib/gpu/lal_device.cpp +++ b/lib/gpu/lal_device.cpp @@ -348,7 +348,7 @@ int DeviceT::init_device(MPI_Comm world, MPI_Comm replica, const int ngpu, } template -int DeviceT::set_ocl_params(std::string s_config, std::string extra_args) { +int DeviceT::set_ocl_params(std::string s_config, const std::string &extra_args) { #ifdef USE_OPENCL #include "lal_pre_ocl_config.h" @@ -368,7 +368,7 @@ int DeviceT::set_ocl_params(std::string s_config, std::string extra_args) { int token_count=0; std::string params[18]; char ocl_config[2048]; - strcpy(ocl_config,s_config.c_str()); + strncpy(ocl_config,s_config.c_str(),2047); char *pch = strtok(ocl_config,","); _ocl_config_name=pch; pch = strtok(nullptr,","); diff --git a/lib/gpu/lal_device.h b/lib/gpu/lal_device.h index adb7fd3ed8..54fcf2f4e8 100644 --- a/lib/gpu/lal_device.h +++ b/lib/gpu/lal_device.h @@ -348,7 +348,7 @@ class Device { int _data_in_estimate, _data_out_estimate; std::string _ocl_config_name, _ocl_config_string, _ocl_compile_string; - int set_ocl_params(std::string, std::string); + int set_ocl_params(std::string, const std::string &); }; } diff --git a/src/OPENMP/pair_lj_long_tip4p_long_omp.cpp b/src/OPENMP/pair_lj_long_tip4p_long_omp.cpp index d6068c6e7a..606e57188a 100644 --- a/src/OPENMP/pair_lj_long_tip4p_long_omp.cpp +++ b/src/OPENMP/pair_lj_long_tip4p_long_omp.cpp @@ -390,7 +390,7 @@ void PairLJLongTIP4PLongOMP::compute_inner() loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(0, 0, nall, 0, 0, nullptr, thr); + ev_setup_thr(0, 0, nall, nullptr, nullptr, nullptr, thr); eval_inner(ifrom, ito, thr); thr->timer(Timer::PAIR); @@ -415,7 +415,7 @@ void PairLJLongTIP4PLongOMP::compute_middle() loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(0, 0, nall, 0, 0, nullptr, thr); + ev_setup_thr(0, 0, nall, nullptr, nullptr, nullptr, thr); eval_middle(ifrom, ito, thr); thr->timer(Timer::PAIR);