Fix error handling in vector.c
This commit is contained in:
parent
accf11ba6c
commit
85b8bc0cbf
@ -47,7 +47,7 @@ bool vector_product(vector *a, vector *b, vector *c)
|
|||||||
vector a_tmp,
|
vector a_tmp,
|
||||||
b_tmp;
|
b_tmp;
|
||||||
|
|
||||||
if (!a || !b)
|
if (!a || !b || !c)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
copy_vector(a, &a_tmp);
|
copy_vector(a, &a_tmp);
|
||||||
@ -75,7 +75,7 @@ bool add_vectors(vector *a, vector *b, vector *c)
|
|||||||
vector a_tmp,
|
vector a_tmp,
|
||||||
b_tmp;
|
b_tmp;
|
||||||
|
|
||||||
if (!a || !b)
|
if (!a || !b || !c)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
copy_vector(a, &a_tmp);
|
copy_vector(a, &a_tmp);
|
||||||
@ -103,7 +103,7 @@ bool sub_vectors(vector *a, vector *b, vector *c)
|
|||||||
vector a_tmp,
|
vector a_tmp,
|
||||||
b_tmp;
|
b_tmp;
|
||||||
|
|
||||||
if (!a || !b)
|
if (!a || !b || !c)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
copy_vector(a, &a_tmp);
|
copy_vector(a, &a_tmp);
|
||||||
|
Loading…
Reference in New Issue
Block a user