diff options
author | deraadt <> | 2015-09-28 18:58:33 +0000 |
---|---|---|
committer | deraadt <> | 2015-09-28 18:58:33 +0000 |
commit | 8120969745e109d6500c765aa47172f27f44b790 (patch) | |
tree | acc1b76c11f9c409b556a5f25699b3433d46554e | |
parent | 3c5ff730c4d5644ecd059a5e3897cdbff13e0126 (diff) | |
download | openbsd-8120969745e109d6500c765aa47172f27f44b790.tar.gz openbsd-8120969745e109d6500c765aa47172f27f44b790.tar.bz2 openbsd-8120969745e109d6500c765aa47172f27f44b790.zip |
remove excessive brackets on pointer math
-rw-r--r-- | src/lib/libcrypto/bn/bn_print.c | 16 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/bn/bn_print.c | 16 |
2 files changed, 16 insertions, 16 deletions
diff --git a/src/lib/libcrypto/bn/bn_print.c b/src/lib/libcrypto/bn/bn_print.c index f97f310eda..1614a11449 100644 --- a/src/lib/libcrypto/bn/bn_print.c +++ b/src/lib/libcrypto/bn/bn_print.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_print.c,v 1.27 2015/09/27 19:41:37 miod Exp $ */ | 1 | /* $OpenBSD: bn_print.c,v 1.28 2015/09/28 18:58:33 deraadt Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -84,16 +84,16 @@ BN_bn2hex(const BIGNUM *a) | |||
84 | } | 84 | } |
85 | p = buf; | 85 | p = buf; |
86 | if (BN_is_negative(a)) | 86 | if (BN_is_negative(a)) |
87 | *(p++) = '-'; | 87 | *p++ = '-'; |
88 | if (BN_is_zero(a)) | 88 | if (BN_is_zero(a)) |
89 | *(p++) = '0'; | 89 | *p++ = '0'; |
90 | for (i = a->top - 1; i >=0; i--) { | 90 | for (i = a->top - 1; i >=0; i--) { |
91 | for (j = BN_BITS2 - 8; j >= 0; j -= 8) { | 91 | for (j = BN_BITS2 - 8; j >= 0; j -= 8) { |
92 | /* strip leading zeros */ | 92 | /* strip leading zeros */ |
93 | v = ((int)(a->d[i] >> (long)j)) & 0xff; | 93 | v = ((int)(a->d[i] >> (long)j)) & 0xff; |
94 | if (z || (v != 0)) { | 94 | if (z || (v != 0)) { |
95 | *(p++) = Hex[v >> 4]; | 95 | *p++ = Hex[v >> 4]; |
96 | *(p++) = Hex[v & 0x0f]; | 96 | *p++ = Hex[v & 0x0f]; |
97 | z = 1; | 97 | z = 1; |
98 | } | 98 | } |
99 | } | 99 | } |
@@ -122,9 +122,9 @@ BN_bn2dec(const BIGNUM *a) | |||
122 | } | 122 | } |
123 | p = buf; | 123 | p = buf; |
124 | if (BN_is_negative(a)) | 124 | if (BN_is_negative(a)) |
125 | *(p++) = '-'; | 125 | *p++ = '-'; |
126 | *(p++) = '0'; | 126 | *p++ = '0'; |
127 | *(p++) = '\0'; | 127 | *p++ = '\0'; |
128 | return (buf); | 128 | return (buf); |
129 | } | 129 | } |
130 | 130 | ||
diff --git a/src/lib/libssl/src/crypto/bn/bn_print.c b/src/lib/libssl/src/crypto/bn/bn_print.c index f97f310eda..1614a11449 100644 --- a/src/lib/libssl/src/crypto/bn/bn_print.c +++ b/src/lib/libssl/src/crypto/bn/bn_print.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_print.c,v 1.27 2015/09/27 19:41:37 miod Exp $ */ | 1 | /* $OpenBSD: bn_print.c,v 1.28 2015/09/28 18:58:33 deraadt Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -84,16 +84,16 @@ BN_bn2hex(const BIGNUM *a) | |||
84 | } | 84 | } |
85 | p = buf; | 85 | p = buf; |
86 | if (BN_is_negative(a)) | 86 | if (BN_is_negative(a)) |
87 | *(p++) = '-'; | 87 | *p++ = '-'; |
88 | if (BN_is_zero(a)) | 88 | if (BN_is_zero(a)) |
89 | *(p++) = '0'; | 89 | *p++ = '0'; |
90 | for (i = a->top - 1; i >=0; i--) { | 90 | for (i = a->top - 1; i >=0; i--) { |
91 | for (j = BN_BITS2 - 8; j >= 0; j -= 8) { | 91 | for (j = BN_BITS2 - 8; j >= 0; j -= 8) { |
92 | /* strip leading zeros */ | 92 | /* strip leading zeros */ |
93 | v = ((int)(a->d[i] >> (long)j)) & 0xff; | 93 | v = ((int)(a->d[i] >> (long)j)) & 0xff; |
94 | if (z || (v != 0)) { | 94 | if (z || (v != 0)) { |
95 | *(p++) = Hex[v >> 4]; | 95 | *p++ = Hex[v >> 4]; |
96 | *(p++) = Hex[v & 0x0f]; | 96 | *p++ = Hex[v & 0x0f]; |
97 | z = 1; | 97 | z = 1; |
98 | } | 98 | } |
99 | } | 99 | } |
@@ -122,9 +122,9 @@ BN_bn2dec(const BIGNUM *a) | |||
122 | } | 122 | } |
123 | p = buf; | 123 | p = buf; |
124 | if (BN_is_negative(a)) | 124 | if (BN_is_negative(a)) |
125 | *(p++) = '-'; | 125 | *p++ = '-'; |
126 | *(p++) = '0'; | 126 | *p++ = '0'; |
127 | *(p++) = '\0'; | 127 | *p++ = '\0'; |
128 | return (buf); | 128 | return (buf); |
129 | } | 129 | } |
130 | 130 | ||