summaryrefslogtreecommitdiffstats
path: root/crypto/asn1
diff options
context:
space:
mode:
authorJ.W. Jagersma <jwjagersma@gmail.com>2022-10-01 18:41:44 +0200
committerHugo Landau <hlandau@openssl.org>2022-11-14 07:47:53 +0000
commit1555c86e5f7e3c46b4f696ed665c2f988976b81f (patch)
treef7f131a40e8f3f4ea2e24206ad7762a00fd7f0c0 /crypto/asn1
parent43086b1bd48958ce95fadba8459ad88675da4fdf (diff)
Cast values to match printf format strings.
For some reason djgpp uses '(unsigned) long int' for (u)int32_t. This causes errors with -Werror=format, even though these types are in practice identical. Obvious solution: cast to the types indicated by the format string. For asn1_time_test.c I changed the format string to %lli since time_t may be 'long long' some platforms. Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19322)
Diffstat (limited to 'crypto/asn1')
-rw-r--r--crypto/asn1/x_int64.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/asn1/x_int64.c b/crypto/asn1/x_int64.c
index d05fe26bb0..b7251b8ad8 100644
--- a/crypto/asn1/x_int64.c
+++ b/crypto/asn1/x_int64.c
@@ -220,8 +220,8 @@ static int uint32_print(BIO *out, const ASN1_VALUE **pval, const ASN1_ITEM *it,
int indent, const ASN1_PCTX *pctx)
{
if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED)
- return BIO_printf(out, "%d\n", **(int32_t **)pval);
- return BIO_printf(out, "%u\n", **(uint32_t **)pval);
+ return BIO_printf(out, "%d\n", (int)**(int32_t **)pval);
+ return BIO_printf(out, "%u\n", (unsigned int)**(uint32_t **)pval);
}