From ffb3f4232fdbd3330e87d089f58dc307c352510b Mon Sep 17 00:00:00 2001 From: Rene Brun <Rene.Brun@cern.ch> Date: Thu, 30 Sep 2010 15:43:50 +0000 Subject: [PATCH] use snprintf git-svn-id: http://root.cern.ch/svn/root/trunk@35936 27541ba8-7e3a-0410-8455-c3a389f83636 --- hist/hist/src/TProfile.cxx | 2 +- hist/hist/src/TProfile2D.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hist/hist/src/TProfile.cxx b/hist/hist/src/TProfile.cxx index d68ea58ee5e..842f18f7d06 100644 --- a/hist/hist/src/TProfile.cxx +++ b/hist/hist/src/TProfile.cxx @@ -890,7 +890,7 @@ char* TProfile::GetObjectInfo(Int_t px, Int_t py) const Double_t x = gPad->PadtoX(gPad->AbsPixeltoX(px)); Double_t y = gPad->PadtoY(gPad->AbsPixeltoY(py)); Int_t binx = GetXaxis()->FindFixBin(x); - sprintf(info,"(x=%g, y=%g, binx=%d, binc=%g, bine=%g, binn=%d)", x, y, binx, GetBinContent(binx), GetBinError(binx), (Int_t)GetBinEntries(binx)); + snprintf(info,200,"(x=%g, y=%g, binx=%d, binc=%g, bine=%g, binn=%d)", x, y, binx, GetBinContent(binx), GetBinError(binx), (Int_t)GetBinEntries(binx)); return info; } diff --git a/hist/hist/src/TProfile2D.cxx b/hist/hist/src/TProfile2D.cxx index cfb24b9a40a..4b672f0c9c5 100644 --- a/hist/hist/src/TProfile2D.cxx +++ b/hist/hist/src/TProfile2D.cxx @@ -1230,7 +1230,7 @@ TH2D *TProfile2D::ProjectionXY(const char *name, Option_t *option) const if (strcmp(name,"_px") == 0) { Int_t nch = strlen(GetName()) + 4; pname = new char[nch]; - sprintf(pname,"%s%s",GetName(),name); + snprintf(pname,nch,"%s%s",GetName(),name); } TH2D *h1 = new TH2D(pname,GetTitle(),nx,fXaxis.GetXmin(),fXaxis.GetXmax(),ny,fYaxis.GetXmin(),fYaxis.GetXmax()); Bool_t computeErrors = kFALSE; -- GitLab