diff --git a/matrix.c b/matrix.c index c4de930..32f3497 100644 --- a/matrix.c +++ b/matrix.c @@ -14,8 +14,11 @@ Matrix createMatrix(unsigned int rows, unsigned int cols) if(rows == 0 || cols == 0) { - printf("Error"); - exit(EXIT_FAILURE); + + m.rows = 0; + m.cols = 0; + m.buffer = NULL; + return m; } m.buffer = calloc(rows * cols, sizeof(MatrixType));