From: Richard M. Stallman Date: Mon, 15 Nov 1993 12:28:01 +0000 (+0000) Subject: (read_avail_input): Make cbuf 1 char shorter. X-Git-Tag: emacs-19.34~10819 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1727083501a3a25c59544e1d535ae9e5f5ffc8a6;p=emacs.git (read_avail_input): Make cbuf 1 char shorter. --- diff --git a/src/keyboard.c b/src/keyboard.c index 249c594d2a8..47092b339fe 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -3027,7 +3027,10 @@ read_avail_input (expected) nread = (*read_socket_hook) (0, buf, KBD_BUFFER_SIZE, expected, expected); else { - unsigned char cbuf[KBD_BUFFER_SIZE]; + /* Using KBD_BUFFER_SIZE - 1 here avoids reading more than + the kbd_buffer can really hold. That may prevent loss + of characters on some systems when input is stuffed at us. */ + unsigned char cbuf[KBD_BUFFER_SIZE - 1]; #ifdef FIONREAD /* Find out how much input is available. */