From 6b998b5ed066aeece1146fe245b35965319b3cbd Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 10 May 2017 16:59:26 +0200 Subject: Cleaner code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/blind-from-image.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/blind-from-image.c') diff --git a/src/blind-from-image.c b/src/blind-from-image.c index 040e8a9..babcc8c 100644 --- a/src/blind-from-image.c +++ b/src/blind-from-image.c @@ -3,16 +3,14 @@ #include "util.h" #include -#include #include #include -#include USAGE("[-h] [-f | -p]") static char buf[BUFSIZ]; -static char width[3 * sizeof(size_t) + 1] = {0}; -static char height[3 * sizeof(size_t) + 1] = {0}; +static char width[INTSTRLEN(size_t) + 1] = {0}; +static char height[INTSTRLEN(size_t) + 1] = {0}; static const char *conv_fail_msg = "convertion failed, if converting a farbfeld file, try -f"; static size_t pixel_size; static double value_max; @@ -143,7 +141,7 @@ pam_head(int fd, const char *fname) else if (!strcmp(buf, "TUPLTYPE RGB_ALPHA")) with_colour = 1, with_alpha = 1; else - eprintf("image uses an unsupported tuple type: %s\n", buf + sizeof("TUPLTYPE")); + eprintf("image uses an unsupported tuple type: %s\n", buf + STRLEN("TUPLTYPE ")); } else if (!strcmp(buf, "ENDHDR")) { memmove(buf, p, ptr -= (size_t)(p - buf)); goto header_done; -- cgit v1.2.3-70-g09d2