# HG changeset patch # User Richard M. Stallman # Date 753366481 0 # Node ID 2802aff49c77035781acff1fa6b5fdca72d3363a # Parent cad49955c59eee51a164722d6a998a22e48a30d2 (read_avail_input): Make cbuf 1 char shorter. diff -r cad49955c59e -r 2802aff49c77 src/keyboard.c --- a/src/keyboard.c Mon Nov 15 12:27:45 1993 +0000 +++ b/src/keyboard.c Mon Nov 15 12:28:01 1993 +0000 @@ -3027,7 +3027,10 @@ 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. */