From 20d013c401539685572397e327606d68f4fac249 Mon Sep 17 00:00:00 2001 From: hasufell Date: Mon, 12 May 2014 19:49:01 +0200 Subject: [PATCH] Improve error handling in copy_vector() --- src/vector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vector.c b/src/vector.c index f7aa64c..60d0c10 100644 --- a/src/vector.c +++ b/src/vector.c @@ -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;