]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
strdup replaced by malloc and strcpy
authortkuhr <tkuhr@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 Apr 2004 12:30:27 +0000 (12:30 +0000)
committertkuhr <tkuhr@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 Apr 2004 12:30:27 +0000 (12:30 +0000)
RAW/raw2date.c

index 31ba57ac9d2153419daa9cf4197c9be0e64ea93a..62d549e40798b0b64090a14079e3294880fa6ddb 100644 (file)
@@ -79,8 +79,12 @@ int handleArgs( const int argc, char * const * const argv ) {
       perror( "malloc failed " );
       return FALSE;
     }
       perror( "malloc failed " );
       return FALSE;
     }
-    if ( (fileNames[ numFiles-1 ] = strdup( argv[arg] )) == NULL ) {
-      perror( "strdup failed " );
+    if ( (fileNames[ numFiles-1 ] = malloc( strlen(argv[arg])+1 )) == NULL ) {
+      perror( "malloc failed " );
+      return FALSE;
+    }
+    if ( (strcpy( fileNames[ numFiles-1 ], argv[arg] )) == NULL ) {
+      perror( "strcpy failed " );
       return FALSE;
     }
   }
       return FALSE;
     }
   }