changeset 5032:2802aff49c77

(read_avail_input): Make cbuf 1 char shorter.
author Richard M. Stallman <rms@gnu.org>
date Mon, 15 Nov 1993 12:28:01 +0000
parents cad49955c59e
children b4ed97a59663
files src/keyboard.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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.  */