Skip to content

Commit

Permalink
Merge pull request #23471 from fwyzard/fix_HcalHashFunctions
Browse files Browse the repository at this point in the history
Fix the length of the string buffer to accommodate the "new format" of the HCAL DetId
  • Loading branch information
cmsbuild committed Jun 6, 2018
2 parents 96f61ee + f61bc2b commit b8aa734
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DQM/HcalCommon/src/HashFunctions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ namespace hcaldqm

std::string name_HFPMiphi(HcalDetId const& did)
{
char name[10];
sprintf(name, "HF%siphi%d", did.ieta()>0 ? "P" : "M", did.iphi());
char name[12];
snprintf(name, sizeof(name), "HF%ciphi%d", did.ieta()>0 ? 'P' : 'M', did.iphi());
return std::string(name);
}

Expand Down

0 comments on commit b8aa734

Please sign in to comment.