summaryrefslogtreecommitdiffstats
path: root/test/asn1_encode_test.c
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2017-11-11 22:23:12 +0100
committerAndy Polyakov <appro@openssl.org>2017-11-13 10:58:57 +0100
commit3a63c0edab842af3e84ef1cad2b4eb701eece3e1 (patch)
treec45bf7fb2f69874b2779b33e5597a59bbc92e648 /test/asn1_encode_test.c
parent802127e8fc07cbef499b645e7e1ae48ce3ed981c (diff)
Resolve warnings in VC-WIN32 build, which allows to add /WX.
It's argued that /WX allows to keep better focus on new code, which motivates its comeback... Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4721)
Diffstat (limited to 'test/asn1_encode_test.c')
-rw-r--r--test/asn1_encode_test.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/asn1_encode_test.c b/test/asn1_encode_test.c
index 3b8d4184be..e9f459ad65 100644
--- a/test/asn1_encode_test.c
+++ b/test/asn1_encode_test.c
@@ -577,14 +577,14 @@ static size_t der_encode_length(size_t len, unsigned char **pp)
if (pp != NULL) {
if (lenbytes == 1) {
- *(*pp)++ = len;
+ *(*pp)++ = (unsigned char)len;
} else {
- *(*pp)++ = lenbytes - 1;
+ *(*pp)++ = (unsigned char)(lenbytes - 1);
if (lenbytes == 2) {
- *(*pp)++ = 0x80 | len;
+ *(*pp)++ = (unsigned char)(0x80 | len);
} else {
- *(*pp)++ = 0x80 | (len >> 8);
- *(*pp)++ = len & 0xff;
+ *(*pp)++ = (unsigned char)(0x80 | (len >> 8));
+ *(*pp)++ = (unsigned char)(len);
}
}
}