]> git.eshelyaron.com Git - emacs.git/commitdiff
(read_avail_input): Make cbuf 1 char shorter.
authorRichard M. Stallman <rms@gnu.org>
Mon, 15 Nov 1993 12:28:01 +0000 (12:28 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 15 Nov 1993 12:28:01 +0000 (12:28 +0000)
src/keyboard.c

index 249c594d2a8082364b90dd9379e92fd8bc6612e3..47092b339fec743addfdd0330c29689fdf6040d7 100644 (file)
@@ -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.  */