wintrust: Sign-compare warnings fix

Juan Lang juan.lang at gmail.com
Wed Dec 10 19:03:37 CST 2008


Hi Andy,

-        if (pbEncoded[1] + 1 > cbEncoded)
+        if (pbEncoded[1] + 1U > cbEncoded)

Is this change necessary?  The resulting code is less clear than the
original, IMO.  It's clearly a spurious warning:  a BYTE (max value
255) + 1 can't yield a value that overflows an unsigned int, so this
comparison will always do what's wanted.

Same with the change here:
-        else if (lenLen + 2 > cbEncoded)
+        else if (lenLen + 2U > cbEncoded)

Otherwise, this patch looks fine to me.
--Juan



More information about the wine-devel mailing list