]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fixing return value of OpenFile and replacing sscanf to make coverity happy
authorrgrosso <rgrosso@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 1 Oct 2010 16:20:22 +0000 (16:20 +0000)
committerrgrosso <rgrosso@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 1 Oct 2010 16:20:22 +0000 (16:20 +0000)
STEER/AliSurveyObj.cxx

index aee3646f1502ff837073118a78d9053dbed0457d..c40adad55afe291db64647afdea29d58e5246d02 100644 (file)
@@ -198,11 +198,11 @@ Bool_t AliSurveyObj::OpenFile(TString openString) {
   }
   AliInfo(Form("%lld bytes read!\n", file->GetBytesRead()));
   
-  ParseBuffer(buf);
+  Bool_t goodParsing = ParseBuffer(buf);
 
   file->Close();
   delete[] buf;
-  return kTRUE;
+  return goodParsing;
 }
 
 
@@ -642,9 +642,9 @@ Bool_t AliSurveyObj::ParseBuffer(const Char_t* buf) {
          nextLine.Remove(TString::kTrailing, '/');
          nextLine = nextLine(nextLine.Last('/') + 1, nextLine.Length() - nextLine.Last('/') + 1);
          
-         Int_t sscanftmp = 0;
-         if (1 != sscanf(nextLine.Data(), "%08d", &sscanftmp)) {
+         if (!nextLine.IsDigit()) {
            AliError("Survey text file sintax error! (incorrectly formatted Report URL)");
+           AliError(Form("Wrong report number string: \"%s\"",nextLine.Data()));
            lines->Delete();
            delete lines; lines = NULL;
            return kFALSE;