Fix VC warnings about unary minus to an unsigned type.
authorKurt Roeckx <kurt@roeckx.be>
Sun, 15 Jan 2017 11:33:45 +0000 (12:33 +0100)
committerRichard Levitte <levitte@openssl.org>
Mon, 20 Mar 2017 21:10:54 +0000 (22:10 +0100)
Reviewed-by: Andy Polyakov <appro@openssl.org>
GH: #2230
(partial cherry pick from commit 68d4bcfd0651c7ea5d37ca52abc0d2e6e6b3bd20)

crypto/asn1/x_long.c

index efdf574e24752c580d5d544ce2881217adf01bbe..2fd3a903d180bb093528e19949eb71735e9b48d3 100644 (file)
@@ -126,7 +126,7 @@ static int long_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype,
      * set.
      */
     if (ltmp < 0)
-        utmp = -(unsigned long)ltmp - 1;
+        utmp = 0 - (unsigned long)ltmp - 1;
     else
         utmp = ltmp;
     clen = BN_num_bits_word(utmp);