diff --git a/roottest/root/io/bigevent/IoBigEventGeneration.cxx b/roottest/root/io/bigevent/IoBigEventGeneration.cxx index 5b68215739fad..b895daa46709d 100644 --- a/roottest/root/io/bigevent/IoBigEventGeneration.cxx +++ b/roottest/root/io/bigevent/IoBigEventGeneration.cxx @@ -286,7 +286,7 @@ void Event::SetHeader(Int_t i, Int_t run, Int_t date, Float_t random) if (i > 10000) nch += 3; if (fEventName) delete [] fEventName; fEventName = new char[nch]; - sprintf(fEventName,"Event%d_Run%d",i,200); + snprintf(fEventName, nch, "Event%d_Run%d", i, 200); fNtrack = 0; fEvtHdr.Set(i, run, date); if (!fgHist) fgHist = new TH1F("hstat","Event Histogram",100,0,1); @@ -299,7 +299,7 @@ void Event::SetHeader(Int_t i, Int_t run, Int_t date, Float_t random) char lachaud[64]; string lac; for (Int_t j=0;j 10000) nch += 3; // if (fTrackName) delete [] fTrackName; fTrackName = new char[nch]; - sprintf(fTrackName,"Track%d",trackNumber); + snprintf(fTrackName, nch, "Track%d", trackNumber); //Int_t i; //fHits.clear(); //for (i=0;i<12;i++) fHits.push_back(i); diff --git a/roottest/root/io/bigevent/IoBigEventGenerator.cxx b/roottest/root/io/bigevent/IoBigEventGenerator.cxx index bb08b841c253f..dd13aec3db953 100644 --- a/roottest/root/io/bigevent/IoBigEventGenerator.cxx +++ b/roottest/root/io/bigevent/IoBigEventGenerator.cxx @@ -204,7 +204,7 @@ int main(int argc, char **argv) Int_t ntrack = Int_t(arg5 +arg5*sigmat/120.); Float_t random = gRandom->Rndm(1); - sprintf(etype,"type%d",ev%5); + snprintf(etype, 20, "type%d", ev % 5); event->SetType(etype); event->SetHeader(ev, 200, 960312, random); event->SetNseg(Int_t(10*ntrack+20*sigmas));