diff options
| author | Mattias Andrée <maandree@kth.se> | 2017-05-10 16:59:26 +0200 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2017-05-10 16:59:26 +0200 |
| commit | 6b998b5ed066aeece1146fe245b35965319b3cbd (patch) | |
| tree | c963b48fbefafcec89a4e4af238869a1cb51148e /src/blind-from-image.c | |
| parent | blind-flip is optimal (diff) | |
| download | blind-6b998b5ed066aeece1146fe245b35965319b3cbd.tar.gz blind-6b998b5ed066aeece1146fe245b35965319b3cbd.tar.bz2 blind-6b998b5ed066aeece1146fe245b35965319b3cbd.tar.xz | |
Cleaner code
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/blind-from-image.c')
| -rw-r--r-- | src/blind-from-image.c | 8 |
1 files changed, 3 insertions, 5 deletions
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 <arpa/inet.h> -#include <sys/wait.h> #include <inttypes.h> #include <string.h> -#include <unistd.h> 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; |
