> From: Thomas Klausner <[email protected]>
> Date: Tue, 25 Jun 2013 23:02:45 +0200
> 
> len is unsigned and can't be smaller than zero.

But vsnprintf(3) returns a signed integer, which can be -1.

> ---
>  src/Alloc.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/src/Alloc.c b/src/Alloc.c
> index c523d81..477dfe0 100644
> --- a/src/Alloc.c
> +++ b/src/Alloc.c
> @@ -140,9 +140,6 @@ Cardinal XtAsprintf(
>      len = vsnprintf(buf, sizeof(buf), format, ap);
>      va_end(ap);
>  
> -    if (len < 0)
> -     _XtAllocError("vsnprintf");
> -
>      *new_string = XtMalloc(len + 1); /* snprintf doesn't count trailing '\0' 
> */
>      if (len < sizeof(buf))
>      {
> -- 
> 1.8.3.1
> 
> _______________________________________________
> [email protected]: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
> 
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to