Subject: bin/28495: skey's -x output does not match described behavior
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <jeffi@rcn.com>
List: netbsd-bugs
Date: 12/01/2004 11:45:00
>Number:         28495
>Category:       bin
>Synopsis:       skey's -x output does not match described behavior
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 01 11:45:00 +0000 2004
>Originator:     Jeff Ito
>Release:        NetBSD 2.99.10
>Organization:
>Environment:
NetBSD 2.99.10
>Description:
skey(1) suggests that the -x argument "list in hexadecimal instead of words".  In fact it lists hex in addition to the words.  This is contradictory to skeyinit's -x output, as well.
>How-To-Repeat:
{2180} skeyinit -x
...

Next login password: A4E7 C328 4A5C 6C63

{2182} skey -x -n 3 98 tesd0059
...
  96: LOGE FUSE TUM CREW SOY CHOW        B190 F50A 3633 DCCC
  97: MEAL BOAT ETC RAM AIRY STAG        B92B 4848 1B14 A3C6
  98: ELY NOEL BITE DUTY AIM CRY         1198 A162 3C70 1218

>Fix:
Modify the man page to accurately describe the output (and ideally keep skeyinit's in sync)

or, modify skey's -x output

Index: skey.c
===================================================================
RCS file: /export/cvs/netbsd/src/usr.bin/skey/skey.c,v
retrieving revision 1.17
diff -u -r1.17 skey.c
--- skey.c      1 Nov 2004 21:52:07 -0000       1.17
+++ skey.c      24 Nov 2004 14:36:28 -0000
@@ -140,10 +140,10 @@
                for (i = 0; i <= n - cnt; i++)
                        f(key);
                for (; i <= n; i++) {
-                       (void)printf("%3d: %-29s", i, btoe(buf, key));
                        if (hexmode)
-                               (void)printf("\t%s", put8(buf, key));
-                       puts("");
+                               (void)printf("%3d: %-29s\n", i, put8(buf, key));
+                       else
+                               (void)printf("%3d: %-29s\n", i, btoe(buf, key));
                        f(key);
                }
        }