From 09bba5091040639f03c7925480d8953b1b1ccc19 Mon Sep 17 00:00:00 2001 From: morsch Date: Wed, 15 Dec 2010 17:44:37 +0000 Subject: [PATCH] Coverity BUFFER SIZE WARNINGS corrected. --- THerwig/AliGenHerwig.cxx | 4 ++-- THerwig/THerwig6.cxx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/THerwig/AliGenHerwig.cxx b/THerwig/AliGenHerwig.cxx index d6d2f76dcb1..3e6048f0334 100644 --- a/THerwig/AliGenHerwig.cxx +++ b/THerwig/AliGenHerwig.cxx @@ -161,7 +161,7 @@ void AliGenHerwig::Init() fHerwig->SetRMASS(4,1.2); fHerwig->SetRMASS(5,4.75); - if ( fProcess < 0 ) strncpy(VVJIN.QQIN,fFileName.Data(),50); + if ( fProcess < 0 ) strncpy(VVJIN.QQIN,fFileName.Data(), 49); //fHerwig->Hwusta("PI0 "); @@ -198,7 +198,7 @@ void AliGenHerwig::InitJimmy() fHerwig->SetRMASS(4,1.2); fHerwig->SetRMASS(5,4.75); - if ( fProcess < 0 ) strncpy(VVJIN.QQIN,fFileName.Data(),50); + if ( fProcess < 0 ) strncpy(VVJIN.QQIN,fFileName.Data(), 49); // fHerwig->Hwusta("PI0 "); diff --git a/THerwig/THerwig6.cxx b/THerwig/THerwig6.cxx index a56f07c2951..4bcb9d6d3e6 100644 --- a/THerwig/THerwig6.cxx +++ b/THerwig/THerwig6.cxx @@ -132,9 +132,9 @@ void THerwig6::Initialize(const char *beam, const char *target, double pbeam1, d // value after calling Initialize and before PrepareRun. char cbeam[8]; - strncpy(cbeam,beam,8); + strncpy(cbeam,beam, 7); char ctarget[8]; - strncpy(ctarget,target,8); + strncpy(ctarget,target, 7); printf("\n Initializing Herwig !! \n"); if ( (!strncmp(beam, "E+" ,2)) && (!strncmp(beam, "E-" ,2)) && @@ -649,7 +649,7 @@ void THerwig6::SetNSTRU (int i) { HWPRAM.NSTRU = i; } // /HWPRCH/ char* THerwig6::GetAUTPDF (int i) { return HWPRCH.AUTPDF[i-1]; } -void THerwig6::SetAUTPDF(int i,const char* s){ strncpy(HWPRCH.AUTPDF[i-1],s,20);} +void THerwig6::SetAUTPDF(int i,const char* s){ strncpy(HWPRCH.AUTPDF[i-1], s, 19);} char* THerwig6::GetBDECAY () { return HWPRCH.BDECAY; } // /HWEVNT/ -- 2.43.0