From 3f494db4629e03e7977b739ea8c034da30332ae7 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 13 Jul 2013 08:01:46 -0700 Subject: [PATCH] tower-test: Use memmove(), not memcpy(), for overlapping memory move. Found by valgrind. --- tests/libpspp/tower-test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/libpspp/tower-test.c b/tests/libpspp/tower-test.c index f5c002652a..78198cb554 100644 --- a/tests/libpspp/tower-test.c +++ b/tests/libpspp/tower-test.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2007, 2010 Free Software Foundation, Inc. + Copyright (C) 2007, 2010, 2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -442,8 +442,8 @@ test_delete (void) assert (j < block_cnt - i); if (expected[j].x == idx) { - memcpy (&expected[j], &expected[j + 1], - sizeof *expected * (block_cnt - i - j - 1)); + memmove (&expected[j], &expected[j + 1], + sizeof *expected * (block_cnt - i - j - 1)); break; } } -- 2.30.2