about summary refs log tree commit diff
path: root/string/test-memcpy.c
diff options
context:
space:
mode:
Diffstat (limited to 'string/test-memcpy.c')
-rw-r--r--string/test-memcpy.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/string/test-memcpy.c b/string/test-memcpy.c
index 2a0994ca98..cb072f8674 100644
--- a/string/test-memcpy.c
+++ b/string/test-memcpy.c
@@ -53,6 +53,12 @@ static void
 do_one_test (impl_t *impl, char *dst, const char *src,
 	     size_t len)
 {
+  size_t i;
+
+  /* Must clear the destination buffer set by the previous run.  */
+  for (i = 0; i < len; i++)
+    dst[i] = 0;
+
   if (CALL (impl, dst, src, len) != MEMCPY_RESULT (dst, len))
     {
       error (0, 0, "Wrong result in function %s %p %p", impl->name,