This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PATCH: Remove strdup use in libgui


> -  hdata->filename = strdup (argv[2]);
> -  hdata->header_filename = strdup (argv[3]);
> +  hdata->filename = malloc (strlen (argv[2]) + 1);
> +  strcpy (hdata->filename, argv[2]);
> +  hdata->header_filename = malloc (strlen (argv[3]) + 1);
> +  strcpy (hdata->header_filename, argv[3]);
>    return TCL_OK;


Mo, I'm puzzled.  Why do this?  What is wrong with strdup()?
	Andrew




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]