BSD 4_4_Lite1 release
[unix-history] / usr / src / usr.bin / netstat / route.c
index aecc83b..7f4ebb6 100644 (file)
@@ -32,7 +32,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)route.c    8.1 (Berkeley) 6/6/93";
+static char sccsid[] = "@(#)route.c    8.3 (Berkeley) 3/9/94";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -400,14 +400,16 @@ p_sockaddr(sa, flags, width)
 
        default:
            {
 
        default:
            {
-               register u_short *s = ((u_short *)sa->sa_data), *slim;
+               register u_char *s = (u_char *)sa->sa_data, *slim;
 
 
-               slim = (u_short *) sa + ((sa->sa_len + sizeof(u_short) - 1) /
-                   sizeof(u_short));
+               slim =  sa->sa_len + (u_char *) sa;
                cplim = cp + sizeof(workbuf) - 6;
                cp += sprintf(cp, "(%d)", sa->sa_family);
                cplim = cp + sizeof(workbuf) - 6;
                cp += sprintf(cp, "(%d)", sa->sa_family);
-               while (s < slim && cp < cplim)
-                       cp += sprintf(cp, " %x", *s++);
+               while (s < slim && cp < cplim) {
+                       cp += sprintf(cp, " %02x", *s++);
+                       if (s < slim)
+                           cp += sprintf(cp, "%02x", *s++);
+               }
                cp = workbuf;
            }
        }
                cp = workbuf;
            }
        }