summaryrefslogtreecommitdiff
path: root/test/realloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/realloc.c')
-rw-r--r--test/realloc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/realloc.c b/test/realloc.c
index c54f270..8106b1f 100644
--- a/test/realloc.c
+++ b/test/realloc.c
@@ -13,6 +13,10 @@ int main(void)
printf("%p: %s\n", ptr, ptr);
ptr = map_realloc(ptr, sizeof(buf) * 2);
- memcpy(ptr + sizeof(buf), buf, sizeof(buf));
+ memcpy(ptr + sizeof(buf) - 1, buf, sizeof(buf));
+ printf("%p: %s\n", ptr, ptr);
+
+ ptr = map_realloc(ptr, sizeof(buf) * sysconf(_SC_PAGESIZE));
+ memcpy(ptr + (2 * sizeof(buf)) - 2, buf, sizeof(buf));
printf("%p: %s\n", ptr, ptr);
}