On a 64 bit machines, uint32_t is promoted to unsigned int when compared with 0 and cannot ever be negative. cast it to int32_t first to force sign extension when comparing with 0.

This commit is contained in:
Steve Checkoway
2008-12-26 23:28:04 +00:00
parent 19e1c8bb4e
commit 382dad70a1
+1 -1
View File
@@ -67,7 +67,7 @@ static int LoadInt(LoadState* S)
LoadVar(S,x);
if (S->flip)
x = Swap32(x);
IF (x<0, "bad integer");
IF ((int32_t)x<0, "bad integer");
return x;
}