correcting string operations
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 22 Nov 2011 12:10:31 +0000 (12:10 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 22 Nov 2011 12:10:31 +0000 (12:10 +0000)
HLT/EMCAL/AliHLTEMCALMapper.cxx

index ac0a285..ff64b0c 100644 (file)
@@ -21,6 +21,7 @@
 #include "AliHLTEMCALMapper.h"
 #include "assert.h"
 #include "AliHLTCaloConstants.h"
+#include "TString.h"
 
 using EMCAL::NXCOLUMNSMOD;
 using EMCAL::NZROWSMOD;
@@ -56,7 +57,7 @@ AliHLTEMCALMapper::GetLocalCoord(const int channelId, Float_t* localCoord) const
 Bool_t 
 AliHLTEMCALMapper::InitAltroMapping(const unsigned long specification )
 {
-  char *base =  getenv("ALICE_ROOT");
+  TString base(getenv("ALICE_ROOT"));
   int  nChannels = 0;
   int  maxaddr = 0; // keep as dummy for now
   int  tmpHwaddr = 0;
@@ -65,10 +66,10 @@ AliHLTEMCALMapper::InitAltroMapping(const unsigned long specification )
   int tmpGain = 0;
   int res = 0; 
   
-  if(base !=0)
+  if(!base.IsNull())
     {
-      snprintf(fFilepath,FILEPATHMAXLENGTH,"%s/EMCAL/mapping/%s", base,   DDL2RcuMapFileName( GetDDLFromSpec( specification ) ) ); 
-      snprintf(fFilepath, FILEPATHMAXLENGTH,"%s/EMCAL/mapping/%s", base,   DDL2RcuMapFileName( GetDDLFromSpec( specification ) ) ); 
+      snprintf(fFilepath,FILEPATHMAXLENGTH,"%s/EMCAL/mapping/%s", base.Data(),   DDL2RcuMapFileName( GetDDLFromSpec( specification ) ) ); 
+      snprintf(fFilepath, FILEPATHMAXLENGTH,"%s/EMCAL/mapping/%s", base.Data(),   DDL2RcuMapFileName( GetDDLFromSpec( specification ) ) ); 
 
       FILE *fp = fopen(fFilepath, "r");
       if(fp != 0)