Make loses argument information.
[unix-history] / usr.bin / netstat / route.c
index a9f8b13..a91d318 100644 (file)
@@ -34,7 +34,7 @@
 #ifndef lint
 /* From: static char sccsid[] = "@(#)route.c   5.20 (Berkeley) 11/29/90"; */
 static const char route_c_rcsid[] =
 #ifndef lint
 /* From: static char sccsid[] = "@(#)route.c   5.20 (Berkeley) 11/29/90"; */
 static const char route_c_rcsid[] =
-       "$Id$";
+       "$Id: route.c,v 1.8 1993/11/17 23:02:57 wollman Exp $";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -349,15 +349,14 @@ int 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 = (u_char *) sa + sa->sa_len;
                cp = workbuf;
                cplim = cp + sizeof(workbuf) - 6;
                cp += sprintf(cp, "(%d)", sa->sa_family);
                while (s < slim && cp < cplim)
                cp = workbuf;
                cplim = cp + sizeof(workbuf) - 6;
                cp += sprintf(cp, "(%d)", sa->sa_family);
                while (s < slim && cp < cplim)
-                       cp += sprintf(cp, " %x", *s++);
+                       cp += sprintf(cp, " %02x%02x", s[0], s[1]), s += 2;
                cp = workbuf;
            }
        }
                cp = workbuf;
            }
        }
@@ -410,7 +409,7 @@ register struct rtentry *rt;
            printf("\n    %7d%c", rt->rt_rmx.rmx_mtu, 
                   (rt->rt_rmx.rmx_locks & RTV_MTU) ? '*' : ' ');
          else
            printf("\n    %7d%c", rt->rt_rmx.rmx_mtu, 
                   (rt->rt_rmx.rmx_locks & RTV_MTU) ? '*' : ' ');
          else
-           printf("\n    %-7s ", "-");
+           printf("\n    %7s ", "-");
 
          /*
           * Hop count
 
          /*
           * Hop count
@@ -419,7 +418,7 @@ register struct rtentry *rt;
            printf(" %7d%c", rt->rt_rmx.rmx_hopcount,
                   (rt->rt_rmx.rmx_locks & RTV_HOPCOUNT) ? '*' : ' ');
          else
            printf(" %7d%c", rt->rt_rmx.rmx_hopcount,
                   (rt->rt_rmx.rmx_locks & RTV_HOPCOUNT) ? '*' : ' ');
          else
-           printf(" %-6s ", "-");
+           printf(" %7s ", "-");
          
          /*
           * Expiration time
          
          /*
           * Expiration time
@@ -428,7 +427,7 @@ register struct rtentry *rt;
            printf(" %7d%c", rt->rt_rmx.rmx_expire,
                   (rt->rt_rmx.rmx_locks & RTV_EXPIRE) ? '*' : ' ');
          else
            printf(" %7d%c", rt->rt_rmx.rmx_expire,
                   (rt->rt_rmx.rmx_locks & RTV_EXPIRE) ? '*' : ' ');
          else
-           printf(" %-7s ", "-");
+           printf(" %7s ", "-");
 
          /*
           * Receive pipe size (bytes)
 
          /*
           * Receive pipe size (bytes)
@@ -437,7 +436,7 @@ register struct rtentry *rt;
            printf(" %7d%c", rt->rt_rmx.rmx_recvpipe,
                   (rt->rt_rmx.rmx_locks & RTV_RPIPE) ? '*' : ' ');
          else
            printf(" %7d%c", rt->rt_rmx.rmx_recvpipe,
                   (rt->rt_rmx.rmx_locks & RTV_RPIPE) ? '*' : ' ');
          else
-           printf(" %-7s ", "-");
+           printf(" %7s ", "-");
 
          /*
           * Send pipe size (bytes)
 
          /*
           * Send pipe size (bytes)
@@ -446,7 +445,7 @@ register struct rtentry *rt;
            printf(" %7d%c", rt->rt_rmx.rmx_sendpipe,
                   (rt->rt_rmx.rmx_locks & RTV_SPIPE) ? '*' : ' ');
          else
            printf(" %7d%c", rt->rt_rmx.rmx_sendpipe,
                   (rt->rt_rmx.rmx_locks & RTV_SPIPE) ? '*' : ' ');
          else
-           printf(" %-7s ", "-");
+           printf(" %7s ", "-");
 
          /*
           * Slow-start threshold (bytes)
 
          /*
           * Slow-start threshold (bytes)
@@ -455,7 +454,7 @@ register struct rtentry *rt;
            printf(" %7d%c", rt->rt_rmx.rmx_ssthresh,
                   (rt->rt_rmx.rmx_locks & RTV_SSTHRESH) ? '*' : ' ');
          else
            printf(" %7d%c", rt->rt_rmx.rmx_ssthresh,
                   (rt->rt_rmx.rmx_locks & RTV_SSTHRESH) ? '*' : ' ');
          else
-           printf(" %-7s ", "-");
+           printf(" %7s ", "-");
 
          /*
           * Round-trip time (seconds)
 
          /*
           * Round-trip time (seconds)
@@ -464,7 +463,7 @@ register struct rtentry *rt;
            printf(" %7.4f%c", (1.0 * rt->rt_rmx.rmx_rtt) / RTM_RTTUNIT,
                   (rt->rt_rmx.rmx_locks & RTV_RTT) ? '*' : ' ');
          else
            printf(" %7.4f%c", (1.0 * rt->rt_rmx.rmx_rtt) / RTM_RTTUNIT,
                   (rt->rt_rmx.rmx_locks & RTV_RTT) ? '*' : ' ');
          else
-           printf(" %-7s ", "-");
+           printf(" %7s ", "-");
 
          /*
           * Round-trip time variance (seconds)
 
          /*
           * Round-trip time variance (seconds)
@@ -473,7 +472,7 @@ register struct rtentry *rt;
            printf(" %7.4f%c", (1.0 * rt->rt_rmx.rmx_rttvar) / RTM_RTTUNIT,
                   (rt->rt_rmx.rmx_locks & RTV_RTTVAR) ? '*' : ' ');
          else
            printf(" %7.4f%c", (1.0 * rt->rt_rmx.rmx_rttvar) / RTM_RTTUNIT,
                   (rt->rt_rmx.rmx_locks & RTV_RTTVAR) ? '*' : ' ');
          else
-           printf(" %-7s ", "-");
+           printf(" %7s ", "-");
        } else {                /* no -a flag */
          if(rt->rt_rmx.rmx_mtu)
            printf(" %6d", rt->rt_rmx.rmx_mtu);
        } else {                /* no -a flag */
          if(rt->rt_rmx.rmx_mtu)
            printf(" %6d", rt->rt_rmx.rmx_mtu);