diff options
author | Matt Caswell <matt@openssl.org> | 2016-06-15 15:59:46 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-06-18 15:34:03 +0100 |
commit | d012c1a17934d4f5aac0bc9853efcb3f831b5b23 (patch) | |
tree | aa4cb252392ab9a810354d620e024f2073fc2611 /apps | |
parent | ac94c8fdb9e8a36e616c80fa8c4aadb455144019 (diff) | |
download | openssl-new-d012c1a17934d4f5aac0bc9853efcb3f831b5b23.tar.gz |
Replace 4 casts with 1
Changing the type of the |str| variable in asn1pars enables us to remove
4 casts with just 1. This silences an OpenBSD warning along the way.
RT4378
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/asn1pars.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/asn1pars.c b/apps/asn1pars.c index d3b1970def..64a2d850cb 100644 --- a/apps/asn1pars.c +++ b/apps/asn1pars.c @@ -61,7 +61,8 @@ int asn1parse_main(int argc, char **argv) BUF_MEM *buf = NULL; STACK_OF(OPENSSL_STRING) *osk = NULL; char *genstr = NULL, *genconf = NULL; - char *infile = NULL, *str = NULL, *oidfile = NULL, *derfile = NULL; + char *infile = NULL, *oidfile = NULL, *derfile = NULL; + unsigned char *str = NULL; char *name = NULL, *header = NULL, *prog; const unsigned char *ctmpbuf; int indent = 0, noout = 0, dump = 0, strictpem = 0, informat = FORMAT_PEM; @@ -154,7 +155,7 @@ int asn1parse_main(int argc, char **argv) goto end; if (strictpem) { - if (PEM_read_bio(in, &name, &header, (unsigned char **)&str, &num) != + if (PEM_read_bio(in, &name, &header, &str, &num) != 1) { BIO_printf(bio_err, "Error reading PEM file\n"); ERR_print_errors(bio_err); @@ -198,14 +199,14 @@ int asn1parse_main(int argc, char **argv) num += i; } } - str = buf->data; + str = (unsigned char *)buf->data; } /* If any structs to parse go through in sequence */ if (sk_OPENSSL_STRING_num(osk)) { - tmpbuf = (unsigned char *)str; + tmpbuf = str; tmplen = num; for (i = 0; i < sk_OPENSSL_STRING_num(osk); i++) { ASN1_TYPE *atmp; @@ -239,7 +240,7 @@ int asn1parse_main(int argc, char **argv) tmpbuf = at->value.asn1_string->data; tmplen = at->value.asn1_string->length; } - str = (char *)tmpbuf; + str = tmpbuf; num = tmplen; } @@ -260,7 +261,7 @@ int asn1parse_main(int argc, char **argv) } } if (!noout && - !ASN1_parse_dump(bio_out, (unsigned char *)&(str[offset]), length, + !ASN1_parse_dump(bio_out, &(str[offset]), length, indent, dump)) { ERR_print_errors(bio_err); goto end; |