[PATCH:libXt 1/6] Remove unnecessary clause.

Thomas Klausner wiz at NetBSD.org
Tue Jun 25 14:25:54 PDT 2013


On Tue, Jun 25, 2013 at 02:18:53PM -0700, Alan Coopersmith wrote:
> On 06/25/13 02:13 PM, Mark Kettenis wrote:
> >>From: Thomas Klausner <wiz at NetBSD.org>
> >>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.
> 
> Right, so I guess we either make len be signed, or change the if statement
> to "if (len == (Cardinal) -1)".

Ok, here's an alternate patch.
 Thomas
-------------- next part --------------
diff --git a/src/Alloc.c b/src/Alloc.c
index c523d81..c9ffce8 100644
--- a/src/Alloc.c
+++ b/src/Alloc.c
@@ -133,7 +133,7 @@ Cardinal XtAsprintf(
     ...)
 {
     char buf[256];
-    Cardinal len;
+    int len;
     va_list ap;
 
     va_start(ap, format);


More information about the xorg-devel mailing list