changeset 51046:2c49296df7d3

(read_process_output): Back out change from 2003-03-09.
author David Kastrup <dak@gnu.org>
date Sat, 17 May 2003 20:03:22 +0000
parents 2d746ed41a7c
children 497252d655f0
files src/process.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/process.c	Sat May 17 20:02:55 2003 +0000
+++ b/src/process.c	Sat May 17 20:03:22 2003 +0000
@@ -4463,18 +4463,18 @@
   if (DATAGRAM_CHAN_P (channel))
     {
       int len = datagram_address[channel].len;
-      nbytes = recvfrom (channel, chars + carryover, readmax,
+      nbytes = recvfrom (channel, chars + carryover, readmax - carryover,
 			 0, datagram_address[channel].sa, &len);
     }
   else
 #endif
   if (proc_buffered_char[channel] < 0)
-    nbytes = emacs_read (channel, chars + carryover, readmax);
+    nbytes = emacs_read (channel, chars + carryover, readmax - carryover);
   else
     {
       chars[carryover] = proc_buffered_char[channel];
       proc_buffered_char[channel] = -1;
-      nbytes = emacs_read (channel, chars + carryover + 1,  readmax - 1);
+      nbytes = emacs_read (channel, chars + carryover + 1,  readmax - 1 - carryover);
       if (nbytes < 0)
 	nbytes = 1;
       else