From dd472b62830e4d349169778d1f8ae4e985d78953 Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Tue, 21 Sep 2021 21:32:17 -0400 Subject: [PATCH] lbximg: Avoid %zu printf format. Some older library implementations don't support %zu conversions. Since the use in lbximg is entirely pointless, this is just gratuitious incompatibility. --- src/pnm.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/pnm.c b/src/pnm.c index 5359ac2..d70d8b5 100644 --- a/src/pnm.c +++ b/src/pnm.c @@ -322,8 +322,7 @@ int img_output_pam(FILE *f, const char *filename, struct lbx_colour *palette) { bool masked = img_is_masked(mask, width, height); - unsigned x, y; - size_t depth; + unsigned x, y, depth; if (fprintf_ascii(f, "P7\nWIDTH %u\nHEIGHT %u\n", width, height) < 0) goto err; @@ -331,7 +330,7 @@ int img_output_pam(FILE *f, const char *filename, if (palette) { depth = masked ? 4 : 3; - if (fprintf_ascii(f, "DEPTH %zu\nMAXVAL 63\n" + if (fprintf_ascii(f, "DEPTH %u\nMAXVAL 63\n" "TUPLTYPE RGB%s\nENDHDR\n", depth, masked ? "_ALPHA" : "") < 0) goto err; @@ -354,7 +353,7 @@ int img_output_pam(FILE *f, const char *filename, } else { depth = masked ? 2 : 1; - if (fprintf_ascii(f, "DEPTH %zu\nMAXVAL 255\n" + if (fprintf_ascii(f, "DEPTH %u\nMAXVAL 255\n" "TUPLTYPE GRAYSCALE%s\nENDHDR\n", depth, masked ? "_ALPHA" : "") < 0) goto err; -- 2.43.2