[PATCH 07/11] Convert existing Xprintf style calls to Xasprintf style

Alan Coopersmith alan.coopersmith at oracle.com
Thu Dec 2 20:00:04 PST 2010


Daniel Stone wrote:
> Hi,
> 
> On Mon, Nov 29, 2010 at 08:57:44PM -0800, Alan Coopersmith wrote:
>> diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
>> index 5800700..a1419d1 100644
>> --- a/hw/xfree86/common/xf86Config.c
>> +++ b/hw/xfree86/common/xf86Config.c
>> @@ -585,10 +585,9 @@ configFiles(XF86ConfFilesPtr fileconf)
>>      else if (fileconf && fileconf->file_fontpath) {
>>  	pathFrom = X_CONFIG;
>>  	if (xf86Info.useDefaultFontPath) {
>> -	    defaultFontPath = Xprintf("%s%s%s",
>> -				      fileconf->file_fontpath,
>> -				      *temp_path ? "," : "", temp_path);
>> -	    if (defaultFontPath != NULL) {
>> +	    if (Xasprintf(&defaultFontPath, "%s%s%s", fileconf->file_fontpath,
>> +			  *temp_path ? "," : "", temp_path) == -1) {
>> +		defaultFontPath = NULL;
>>  		must_copy = FALSE;
>>  	    }
>>  	}
> 
> It looks like you've inverted the sense of this branch - try:
> if (Xasprintf(&defaultFontPath, ...) == -1)
>     defaultFontPath = NULL;
> else
>     must_copy = FALSE;

Oh! You're right!  Thanks, good catch - will fix.

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list