Improve error handling in copy_vector()

This commit is contained in:
2014-05-12 19:49:01 +02:00
parent ce4032f0be
commit 20d013c401

View File

@@ -156,7 +156,7 @@ bool normalize_vector(vector *a, vector *b)
*/
bool copy_vector(vector *a, vector *b)
{
if (!a || !b)
if (!a || !b || (a == b))
return false;
b->x = a->x;