Improve error handling in copy_vector()
This commit is contained in:
parent
ce4032f0be
commit
20d013c401
@ -156,7 +156,7 @@ bool normalize_vector(vector *a, vector *b)
|
|||||||
*/
|
*/
|
||||||
bool copy_vector(vector *a, vector *b)
|
bool copy_vector(vector *a, vector *b)
|
||||||
{
|
{
|
||||||
if (!a || !b)
|
if (!a || !b || (a == b))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
b->x = a->x;
|
b->x = a->x;
|
||||||
|
Loading…
Reference in New Issue
Block a user