From d03ca65a4d924e6cb04683fa2a49fa5170eaa530 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 2 May 2006 13:58:19 +0200 Subject: [PATCH] [PATCH] vmsplice2: page spanning needs 3 pages --- vmsplice2.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vmsplice2.c b/vmsplice2.c index 5e18371..448ba93 100644 --- a/vmsplice2.c +++ b/vmsplice2.c @@ -109,16 +109,16 @@ int main(int argc, char *argv[]) if (cross_page) { void *ptr; - ptr = ALIGN(malloc(2 * PAGE_SIZE)); - h = ptr - (strlen(S1) / 2); + ptr = ALIGN(malloc(3 * PAGE_SIZE)); + h = ptr + PAGE_SIZE - (strlen(S1) / 2); strcpy(h, S1); - ptr = ALIGN(malloc(2 * PAGE_SIZE)); - b = ptr - (strlen(S2) / 2); + ptr = ALIGN(malloc(3 * PAGE_SIZE)); + b = ptr + PAGE_SIZE - (strlen(S2) / 2); strcpy(b, S2); - ptr = ALIGN(malloc(2 * PAGE_SIZE)); - f = ptr - (strlen(S3) / 2); + ptr = ALIGN(malloc(3 * PAGE_SIZE)); + f = ptr + PAGE_SIZE - (strlen(S3) / 2); strcpy(f, S3); } else { h = strdup(S1); -- 2.25.1