Coverity fixes.
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 31 Jan 2011 13:36:16 +0000 (13:36 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 31 Jan 2011 13:36:16 +0000 (13:36 +0000)
MONITOR/deroot.cxx
MONITOR/root2date.cxx

index 2f8380a..0afae0f 100644 (file)
@@ -58,9 +58,9 @@ int deroot(const char *rootFileName, const char *dateFileName, const char *ddlFi
   size_t gdcSize;
   if (ddlFilesFolder) {
     char command[256];
-    sprintf(command, "rm -rf %s/raw%ld", ddlFilesFolder, gdcCounter);
+    snprintf(command, sizeof(command), "rm -rf %s/raw%ld", ddlFilesFolder, gdcCounter);
     gSystem->Exec(command);
-    sprintf(command, "%s/raw%ld", ddlFilesFolder, gdcCounter);
+    snprintf(command, sizeof(command), "%s/raw%ld", ddlFilesFolder, gdcCounter);
     if (gSystem->MakeDirectory(command) < 0) {
       cerr << "Can not create directory " << command << endl;
       return(1);
index 0e2f923..06b9e85 100644 (file)
@@ -19,7 +19,7 @@ int Root2Date(AliRawVEvent *gdcRootEvent, unsigned char *gdcDateEvent, char *ddl
  aliHeader=gdcRootEvent->GetHeader();
 
  char runNbFileName[256];
- sprintf(runNbFileName,"%s/run%u",ddlDir,aliHeader->Get("RunNb"));
+ snprintf(runNbFileName,sizeof(runNbFileName),"%s/run%u",ddlDir,aliHeader->Get("RunNb"));
  ofstream runNbFile(runNbFileName);
  runNbFile.close();