Commit 82c5644b authored by Wouter Deconinck's avatar Wouter Deconinck
Browse files

strncpy instead of assignment

parent e300ecbe
Pipeline #18935 passed with stages
in 33 seconds
......@@ -194,10 +194,8 @@ TGraph* build_1D_field_graph(dd4hep::Detector& detector, const settings& s,
/** Cell size example.
*
*/
void mag_field(dd4hep::Detector& detector){
double z0 = 0.0;
void mag_field(dd4hep::Detector& detector)
{
double x_min = -100.0;
double x_max = 100.0;
double y_min = -100.0;
......@@ -272,7 +270,8 @@ int main (int argc, char *argv[]) {
int root_argc = 0;
char *root_argv[1];
argv[0] = "npdet_fields";
std::string argv0("npdet_fields");
strncpy(root_argv[0], argv0.c_str(), argv0.size());
TApplication theApp("tapp", &root_argc, root_argv);
......
......@@ -229,10 +229,11 @@ int main (int argc, char *argv[]) {
void run_part_mode(const settings& s)
{
int root_argc = 0;
char *root_argv[1] = {"npdet_to_teve"};
//argv[0] = "npdet_fields";
int root_argc = 0;
char *root_argv[1];
std::string argv0("npdet_to_teve");
strncpy(root_argv[0], argv0.c_str(), argv0.size());
gErrorIgnoreLevel = kWarning;// kPrint, kInfo, kWarning,
TApplication app("tapp", &root_argc, root_argv);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment