34c34
< * $Id: tty_pty.c,v 1.38 1996/02/29 00:18:11 hsu Exp $
---
> * $Id: tty_pty.c,v 1.37 1996/03/11 02:24:39 hsu Exp $
537,538c537,549
< if (cc)
< cc -= b_to_q((char *)cp, cc, &tp->t_canq);
---
> if (cc > 0) {
> cc = b_to_q((char *)cp, cc, &tp->t_canq);
> /*
> * XXX we don't guarantee that the canq size
> * is >= TTYHOG, so the above b_to_q() may
> * leave some bytes uncopied. However, space
> * is guaranteed for the null terminator if
> * we don't fail here since (TTYHOG - 1) is
> * not a multiple of CBSIZE.
> */
> if (cc > 0)
> break;
> }
577c588
< * in outq, or space in rawq.
---
> * in outq, or space in rawq, or an empty canq.
< * $Id: tty_pty.c,v 1.38 1996/02/29 00:18:11 hsu Exp $
---
> * $Id: tty_pty.c,v 1.37 1996/03/11 02:24:39 hsu Exp $
537,538c537,549
< if (cc)
< cc -= b_to_q((char *)cp, cc, &tp->t_canq);
---
> if (cc > 0) {
> cc = b_to_q((char *)cp, cc, &tp->t_canq);
> /*
> * XXX we don't guarantee that the canq size
> * is >= TTYHOG, so the above b_to_q() may
> * leave some bytes uncopied. However, space
> * is guaranteed for the null terminator if
> * we don't fail here since (TTYHOG - 1) is
> * not a multiple of CBSIZE.
> */
> if (cc > 0)
> break;
> }
577c588
< * in outq, or space in rawq.
---
> * in outq, or space in rawq, or an empty canq.