From 5702296e87151be2f8ab2996ad567dd3d22678b1 Mon Sep 17 00:00:00 2001 From: Cosmin Popa Date: Tue, 12 Mar 2024 12:43:12 +0200 Subject: [PATCH] Fix pixels reverse solution to use width for swapRows The proposed solution for reversePic erroneously passes the height of the image to the ancillary function that swaps rows. Updated to use width instead. Signed-off-by: Cosmin Popa --- .../content/operatii-memorie-gdb/solution/3-pixels/pixels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laborator/content/operatii-memorie-gdb/solution/3-pixels/pixels.c b/laborator/content/operatii-memorie-gdb/solution/3-pixels/pixels.c index 14ed4f2c..ca5cac52 100644 --- a/laborator/content/operatii-memorie-gdb/solution/3-pixels/pixels.c +++ b/laborator/content/operatii-memorie-gdb/solution/3-pixels/pixels.c @@ -34,7 +34,7 @@ void reversePic(Picture *pic) { for (int i = 0; i < pic->height / 2; ++i) swapRows(pic->pix_array[i], pic->pix_array[pic->height - 1 - i], - pic->height); + pic->width); } int main(void)