Subject: bin/1325: tip computes parity wrong for zero parity
To: None <gnats-bugs@NetBSD.ORG>
From: Trevor Blackwell <tlb@protagoras.eecs.harvard.edu>
List: netbsd-bugs
Date: 08/09/1995 11:31:05
>Number:         1325
>Category:       bin
>Synopsis:       tip computes parity wrong for zero parity
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug  9 11:50:04 1995
>Last-Modified:
>Originator:     Trevor Blackwell
>Organization:
Harvard
--
Trevor Blackwell         tlb@eecs.harvard.edu          (617) 495-8912
>Release:        Aug 4
>Environment:
all
System: NetBSD protagoras 1.0A NetBSD 1.0A (PROTAGORAS) #13: Mon Jun 5 15:17:44 EDT 1995 tlb@protagoras:/usr/src/sys/arch/i386/compile/PROTAGORAS i386


>Description:
Tip works incorrectly when parity is set to none - it would apply odd
parity. This made it not be able to communicate with most consoles.

>How-To-Repeat:
Run tip with parity=zero (or pa=zero in remote(5))
Transmission will always be even parity

>Fix:
The error was a misunderstanding of C precedence rules; here is the
fix.

*** /usr/src/usr.bin/tip/tip.c       Wed Aug  9 11:05:19 1995
--- /usr/src/usr.bin/tip/tip.c-orig  Wed Aug  9 11:04:56 1995
***************
*** 600,604 ****
                (void) fflush(stderr);
        }
        for (i = 0; i < 0200; i++)
!               partab[i] = (evenpartab[i] ^ flip | set) & clr;
  }
--- 600,604 ----
                (void) fflush(stderr);
        }
        for (i = 0; i < 0200; i++)
!               partab[i] = evenpartab[i] ^ flip | set & clr;
  }

>Audit-Trail:
>Unformatted: