From ae7fb50f90a79743eb6c6ed564a5742c2bb5c7d5 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Mon, 25 Apr 2016 23:22:50 +1200 Subject: Initialise everything for good form --- pgm-interlace.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'pgm-interlace.c') diff --git a/pgm-interlace.c b/pgm-interlace.c index 7596fe5..8aa94d6 100644 --- a/pgm-interlace.c +++ b/pgm-interlace.c @@ -27,7 +27,6 @@ /* * general FIXME: - * be strict about initialisation of vars * add func names to error messages * consolidate magic number string to #define or something. hardcoded is evil */ @@ -162,9 +161,13 @@ int parse_header(FILE *fd, char *magic, long *width, long *height, int *white) int main(int argc, char **argv) { - int i; - unsigned int x, y; - long width, size, new_width, new_size; + int i = 0; + unsigned int x = 0; + unsigned int y = 0; + long width = 0; + long size = 0; + long new_width = 0; + long new_size = 0; int white, new_white; int clust_total = argc-1; FILE **f = NULL; -- cgit v1.1