Skip to content
Snippets Groups Projects
Commit ffb3f423 authored by Rene Brun's avatar Rene Brun
Browse files

use snprintf

git-svn-id: http://root.cern.ch/svn/root/trunk@35936 27541ba8-7e3a-0410-8455-c3a389f83636
parent 446a1212
No related branches found
No related tags found
No related merge requests found
...@@ -890,7 +890,7 @@ char* TProfile::GetObjectInfo(Int_t px, Int_t py) const ...@@ -890,7 +890,7 @@ char* TProfile::GetObjectInfo(Int_t px, Int_t py) const
Double_t x = gPad->PadtoX(gPad->AbsPixeltoX(px)); Double_t x = gPad->PadtoX(gPad->AbsPixeltoX(px));
Double_t y = gPad->PadtoY(gPad->AbsPixeltoY(py)); Double_t y = gPad->PadtoY(gPad->AbsPixeltoY(py));
Int_t binx = GetXaxis()->FindFixBin(x); 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; return info;
} }
......
...@@ -1230,7 +1230,7 @@ TH2D *TProfile2D::ProjectionXY(const char *name, Option_t *option) const ...@@ -1230,7 +1230,7 @@ TH2D *TProfile2D::ProjectionXY(const char *name, Option_t *option) const
if (strcmp(name,"_px") == 0) { if (strcmp(name,"_px") == 0) {
Int_t nch = strlen(GetName()) + 4; Int_t nch = strlen(GetName()) + 4;
pname = new char[nch]; 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()); TH2D *h1 = new TH2D(pname,GetTitle(),nx,fXaxis.GetXmin(),fXaxis.GetXmax(),ny,fYaxis.GetXmin(),fYaxis.GetXmax());
Bool_t computeErrors = kFALSE; Bool_t computeErrors = kFALSE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment