--- source/newio.c.orig Fri May 26 09:33:34 2000 +++ source/newio.c Fri May 26 09:41:04 2000 @@ -174,7 +174,7 @@ c; fd_set rd; int BufferEmpty; - int num = 0; + int count = 3; /* This should be plenty. */ init_io(); if (io_rec[des] == (MyIO *) 0) @@ -188,7 +188,7 @@ #endif /* ESIX */ } - while (1) + while (count-- > 0) { if ((BufferEmpty = (io_rec[des]->read_pos == io_rec[des]->write_pos))) { @@ -216,13 +216,13 @@ if (io_rec[des]->flags & IO_SOCKET) c = recv(des, io_rec[des]->buffer + io_rec[des]->write_pos, - IO_BUFFER_SIZE-io_rec[des]->write_pos, + IO_BUFFER_SIZE-io_rec[des]->write_pos - 1, 0); else #endif /* ESIX */ c = read(des, io_rec[des]->buffer + io_rec[des]->write_pos, - IO_BUFFER_SIZE-io_rec[des]->write_pos); + IO_BUFFER_SIZE-io_rec[des]->write_pos - 1); if (c <= 0) { @@ -248,6 +248,7 @@ } } } + return -1; /* Line has too many segments -- punt */ } /*