]> git.eshelyaron.com Git - emacs.git/commitdiff
(read_process_output): Back out change from 2003-03-09.
authorDavid Kastrup <dak@gnu.org>
Sat, 17 May 2003 20:03:22 +0000 (20:03 +0000)
committerDavid Kastrup <dak@gnu.org>
Sat, 17 May 2003 20:03:22 +0000 (20:03 +0000)
src/process.c

index 6dc052e716b0aafe1e950532d2a62fbf1e27379b..9790b7d29a691391321cbeca0bce95f13e3dac0c 100644 (file)
@@ -4463,18 +4463,18 @@ read_process_output (proc, channel)
   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