]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/raw2date.c
strdup replaced by malloc and strcpy
[u/mrichter/AliRoot.git] / 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;
     }
-    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;
     }
   }