From 4cc1041e88f95b7f350a132721227df477ae69d1 Mon Sep 17 00:00:00 2001 From: augustin64 Date: Sun, 20 Mar 2022 15:00:53 +0100 Subject: [PATCH] Remove offset in read_images --- src/preview_mnist.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/preview_mnist.c b/src/preview_mnist.c index d677eae..3e5ea90 100644 --- a/src/preview_mnist.c +++ b/src/preview_mnist.c @@ -15,7 +15,7 @@ uint32_t swap_endian(uint32_t val) { // commencant à l'adresse mémoire start // dans le fichier pointé par ptr void print_image(unsigned int width, unsigned int height, FILE* ptr, int start) { - unsigned char buffer[width*height+start]; + unsigned char buffer[width*height]; fread(buffer, sizeof(buffer), 1, ptr); @@ -24,7 +24,7 @@ void print_image(unsigned int width, unsigned int height, FILE* ptr, int start) for (int i=0; i