diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 63d093ae1..5d73ecda6 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -1251,7 +1251,7 @@ boolean HU_Responder(event_t *ev) if (chatlen+pastelen > HU_MAXMSGLEN) return true; // we can't paste this!! - memmove(&w_chat[c_input + pastelen], &w_chat[c_input], pastelen); + memmove(&w_chat[c_input + pastelen], &w_chat[c_input], (chatlen - c_input) + 1); // +1 for '\0' memcpy(&w_chat[c_input], paste, pastelen); // copy all of that. c_input += pastelen; return true;