Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!uw-beaver!teknowledge-vaxc!mkhaw From: mkhaw@teknowledge-vaxc.ARPA (Mike Khaw) Newsgroups: comp.sources.bugs Subject: bug in vn 04/88 rot13 Message-ID: <25303@teknowledge-vaxc.ARPA> Date: 4 Oct 88 21:01:57 GMT Reply-To: mkhaw@teknowledge-vaxc.ARPA (Mike Khaw) Organization: Teknowledge, Inc., Palo Alto CA Lines: 30 The algorithm used by the vn newsreader to (un)rot13 doesn't work correctly for every character. Specifically, I find that "k" and "m" get mapped to non-printing characters. I replaced vn's algorithm with the one used by rn. The fix is really too short for a patch. Just replace the rot_line() function in reader.c with the following version: <--- cut here ---> static rot_line (s) unsigned char *s; { /* short circuit if no rot */ if (Rot == 0) return; for ( ; *s != '\0'; ++s) { /* adapted from rn's rot algorithm */ *s += isalpha(*s) ? ((*s & 31) <= 13) ? Rot : -Rot : 0; } } <--- cut here ---> Mike Khaw -- internet: mkhaw@teknowledge.arpa uucp: {uunet|sun|ucbvax|decwrl|uw-beaver}!mkhaw%teknowledge.arpa hardcopy: Teknowledge Inc, 1850 Embarcadero Rd, POB 10119, Palo Alto, CA 94303