]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliRunLoader.cxx
Coverity fixes
[u/mrichter/AliRoot.git] / STEER / AliRunLoader.cxx
index 3e0f17257a7f1130e6acc91f33258732431c148a..3ebc988d3961d455db6a7873d8fe6d96100c0d50 100644 (file)
@@ -1662,7 +1662,7 @@ AliLoader* AliRunLoader::GetDetectorLoader(const char* detname)
 //run loader object
   
   char loadername[256];
-  sprintf(loadername, "%sLoader", detname);
+  snprintf(loadername, 255, "%sLoader", detname);
   AliLoader* loader = GetLoader(loadername);
   if (!loader) {
     AliError(Form("No loader for %s found", detname));
@@ -1821,13 +1821,13 @@ void AliRunLoader::GetListOfDetectors(const char * namelist,TObjArray& pointerar
   
    char buff[10];
    char dets [200];
-   strcpy(dets,namelist);//compiler cries when char* = const Option_t*;
-   dets[strlen(dets)+1] = '\n';//set endl at the end of string 
+   strncpy(dets,namelist,199);//compiler cries when char* = const Option_t*;
+   //   dets[strlen(dets)+1] = '\n';//set endl at the end of string 
    char* pdet = dets;
    Int_t tmp;
    for(;;)
     {
-      tmp = sscanf(pdet,"%s",buff);//read the string from the input string pdet into buff
+      tmp = sscanf(pdet,"%9s",buff);//read the string from the input string pdet into buff
       if ( (buff[0] == 0) || (tmp == 0) ) break; //if not read
      
       pdet = strstr(pdet,buff) + strlen(buff);//move the input pointer about number of bytes (letters) read