[PATCH] Typo in xserver Xvasprintf()

Alan Coopersmith alan.coopersmith at oracle.com
Thu Dec 9 16:13:49 PST 2010


Colin Harrison wrote:
> Hi,
> 
> I needed this patch in the wrapper around vsnprintf() in os/xprintf.c (MinGW
> for Windows build) to correct various crashes.
> 
> --- ./os/save_xprintf.c 2010-12-09 00:01:19.000000000 +0000
> +++ ./os/xprintf.c      2010-12-09 23:47:34.000000000 +0000
> @@ -108,7 +108,7 @@
>          return -1;
> 
>      vsnprintf(*ret, size + 1, format, va);
> -    ret[size] = 0;
> +    (*ret)[size] = 0;
>      return size;
>  #endif
>  }

Ouch! Sorry about that.   (Though the whole line may not really be
necessary at all, since the vsnprintf should be null terminating it.)

Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

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



More information about the xorg-devel mailing list