From 9d66d09ba2000d3b9c81fd60eb8e8feb152263e1 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Thu, 13 Apr 2006 11:25:03 +0100 Subject: [PATCH] Use memmove instead of memcpy for overlapping areas (console scroll). Use memset instead of memcpy to clear line. Signed-off-by: Tristan Gingold --- xen/drivers/char/console.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index 948000c743..41ce2b6009 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -180,12 +180,10 @@ static void put_newline(void) if (ypos >= LINES) { - static char zeroarr[2*COLUMNS] = { 0 }; ypos = LINES-1; - memcpy((char*)video, - (char*)video + 2*COLUMNS, (LINES-1)*2*COLUMNS); - memcpy((char*)video + (LINES-1)*2*COLUMNS, - zeroarr, 2*COLUMNS); + memmove((char*)video, + (char*)video + 2*COLUMNS, (LINES-1)*2*COLUMNS); + memset((char*)video + (LINES-1)*2*COLUMNS, 0, 2*COLUMNS); } } -- 2.39.5