[PATCH 07/11] Convert existing Xprintf style calls to Xasprintf style
Daniel Stone
daniel at fooishbar.org
Wed Dec 1 13:01:05 PST 2010
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;
Otherwise, looks good to me.
Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20101201/cb1449a8/attachment.pgp>
More information about the xorg-devel
mailing list