From 050f24465c3d3fe80515d6de8a221ce983c030fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Tue, 19 Jul 2005 18:49:05 +0000 Subject: [PATCH] print size_t by casting to unsigned long and use right printf format tags are unsigned integers git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15679 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/asn1/asn1_print.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/asn1/asn1_print.c b/lib/asn1/asn1_print.c index cdfee813d..25a781084 100644 --- a/lib/asn1/asn1_print.c +++ b/lib/asn1/asn1_print.c @@ -55,7 +55,7 @@ loop (unsigned char *buf, size_t len, int indent) int ret; Der_class class; Der_type type; - int tag; + unsigned int tag; size_t sz; size_t length; size_t loop_length = 0; @@ -112,7 +112,7 @@ loop (unsigned char *buf, size_t len, int indent) (unsigned)length, (unsigned)len); } if (class == ASN1_C_CONTEXT || class == ASN1_C_APPL) { - printf ("%d bytes [%d]\n", length, tag); + printf ("%lu bytes [%u]\n", (unsigned long)length, tag); if (type == CONS) loop_length = loop (buf, length, indent + 2); } else if (class == ASN1_C_UNIV) { @@ -142,7 +142,8 @@ loop (unsigned char *buf, size_t len, int indent) errx (1, "der_get_integer: %s", error_message (ret)); printf ("integer %d\n", val); } else { - printf ("BIG NUM integer: length %d\n", length); + printf ("BIG NUM integer: length %lu\n", + (unsigned long)length); } break; }