bug fix in create matrix
This commit is contained in:
parent
b661866a16
commit
4aee809756
7
matrix.c
7
matrix.c
@ -14,8 +14,11 @@ Matrix createMatrix(unsigned int rows, unsigned int cols)
|
|||||||
|
|
||||||
if(rows == 0 || cols == 0)
|
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));
|
m.buffer = calloc(rows * cols, sizeof(MatrixType));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user