Improve error handling in copy_vector()

This commit is contained in:
hasufell 2014-05-12 19:49:01 +02:00
parent ce4032f0be
commit 20d013c401
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020
1 changed files with 1 additions and 1 deletions

View File

@ -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;