From: tkuhr Date: Thu, 22 Apr 2004 12:30:27 +0000 (+0000) Subject: strdup replaced by malloc and strcpy X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=1e54e9aea3365c6e2582255673fe19ac4c1fcaca strdup replaced by malloc and strcpy --- diff --git a/RAW/raw2date.c b/RAW/raw2date.c index 31ba57ac9d2..62d549e4079 100644 --- a/RAW/raw2date.c +++ b/RAW/raw2date.c @@ -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; } }