Added line to prevent zero division.

This commit is contained in:
Sheldon Lee 2020-07-05 13:45:57 +01:00
parent 67e216d4ee
commit 4307992cbc

1
grid.c
View File

@ -51,6 +51,7 @@ bool getPixel(Grid* grid, int x, int y)
void getDimensions(Grid* grid, unsigned int* width, unsigned int* height)
{
if (grid->size == 0) return;
*width = grid->width;
*height = grid->size/grid->width;
}