From 1f4ef0357b70a4422b2c33629a5ac230e26f8e27 Mon Sep 17 00:00:00 2001 From: stpohle Date: Mon, 30 Jun 2003 18:15:18 +0000 Subject: [PATCH] memcpy of all the lines --- src/chat.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/chat.c b/src/chat.c index 6c09491..7cbf6ef 100644 --- a/src/chat.c +++ b/src/chat.c @@ -15,11 +15,12 @@ _chat chat; int chat_findfreeline () { - int i; + int i; i = chat.lastline; + if (i >= CHAT_MAX_LINES) { - memcpy (chat.lines[1], chat.lines[0], 255); - i = 255; + memcpy (chat.lines[1], chat.lines[0], 255 * (CHAT_MAX_LINES - 1)); + i = CHAT_MAX_LINES - 1; } else chat.lastline++;