From d8bd85fba865508c0c6dff57b14c98f3ca70bbfc Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Mon, 17 Oct 2022 19:18:06 +0200 Subject: [PATCH] Cast size_t to long to mute warning on 32bit systems Cast size_t to long to mute warning on 32bit systems. Signed-off-by: Christian Marangi --- eperd/evtdig.c | 10 +++++----- eperd/sslgetcert.c | 2 +- libbb/atlas_bb64.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) --- a/eperd/evtdig.c +++ b/eperd/evtdig.c @@ -3792,7 +3792,7 @@ unsigned char* ReadName(unsigned char *b /* Bad format */ snprintf((char *)name, sizeof(name), "format-error at %lu: value 0x%x", - offset, len); + (unsigned long)offset, len); *count= -1; free(name); name= NULL; return name; @@ -3803,7 +3803,7 @@ unsigned char* ReadName(unsigned char *b { snprintf((char *)name, sizeof(name), "offset-error at %lu: offset %lu", - offset, noffset); + (unsigned long)offset, (unsigned long)noffset); *count= -1; free(name); name= NULL; return name; @@ -3814,7 +3814,7 @@ unsigned char* ReadName(unsigned char *b /* Too many */ snprintf((char *)name, sizeof(name), "too many redirects at %lu", - offset); + (unsigned long)offset); *count= -1; free(name); name= NULL; return name; @@ -3836,7 +3836,7 @@ unsigned char* ReadName(unsigned char *b { snprintf((char *)name, sizeof(name), "buf-bounds-error at %lu: len %d", - offset, len); + (unsigned long)offset, len); *count= -1; free(name); name= NULL; return name; @@ -3846,7 +3846,7 @@ unsigned char* ReadName(unsigned char *b { snprintf((char *)name, sizeof(name), "name-length-error at %lu: len %d", - offset, p+len+1); + (unsigned long)offset, p+len+1); *count= -1; free(name); name= NULL; return name; --- a/eperd/sslgetcert.c +++ b/eperd/sslgetcert.c @@ -182,7 +182,7 @@ static void buf_add(struct buf *buf, con newbuf= malloc(maxsize); if (!newbuf) { - fprintf(stderr, "unable to allocate %ld bytes\n", maxsize); + fprintf(stderr, "unable to allocate %ld bytes\n", (long)maxsize); exit(1); } --- a/libbb/atlas_bb64.c +++ b/libbb/atlas_bb64.c @@ -43,7 +43,7 @@ int buf_add(struct buf *buf, const void newbuf= malloc(maxsize); if (!newbuf) { - fprintf(stderr, "unable to allocate %ld bytes\n", maxsize); + fprintf(stderr, "unable to allocate %ld bytes\n", (long)maxsize); return (1); }