bug in "portable way to do nap()"

Andrew Klossner andrew at frip.gwd.tek.com
Tue Oct 11 05:39:55 AEST 1988


>	int baudrate[] = {
>		50,

This is followed by code which subscripts baudrate[tty.c_cflags&CBAUD].
There's an off-by-one here.  baudrate[1], not baudrate[0], should be
50, and the baudrate array should contain 16, not 15, elements.  See
the termio(7) man page for details.

  -=- Andrew Klossner   (uunet!tektronix!tekecs!frip!andrew)    [UUCP]
                        (andrew%frip.gwd.tek.com at relay.cs.net)  [ARPA]



More information about the Comp.unix.wizards mailing list