/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved. The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
+ * Copyright (c) 1983, 1988 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley. The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef lint
-static char sccsid[] = "@(#)route.c 5.11 (Berkeley) 87/08/29";
-#endif
+static char sccsid[] = "@(#)route.c 5.14 (Berkeley) %G%";
+#endif /* not lint */
#include <stdio.h>
#include <strings.h>
read(kmem, (char *)&ifnet, sizeof (ifnet));
klseek(kmem, (off_t)ifnet.if_name, 0);
read(kmem, name, 16);
- printf(" %s%d\n", name, ifnet.if_unit);
+ printf(" %.15s%d\n", name, ifnet.if_unit);
m = mb.m_next;
}
}
struct in_addr in;
{
register char *cp;
- static char line[50];
+ static char line[MAXHOSTNAMELEN + 1];
struct hostent *hp;
static char domain[MAXHOSTNAMELEN + 1];
static int first = 1;
}
}
if (cp)
- strcpy(line, cp);
+ strncpy(line, cp, sizeof(line) - 1);
else {
#define C(x) ((x) & 0xff)
in.s_addr = ntohl(in.s_addr);
u_long mask;
{
char *cp = 0;
- static char line[50];
+ static char line[MAXHOSTNAMELEN + 1];
struct netent *np = 0;
u_long net;
register i;
cp = np->n_name;
}
if (cp)
- strcpy(line, cp);
+ strncpy(line, cp, sizeof(line) - 1);
else if ((i & 0xffffff) == 0)
sprintf(line, "%u", C(i >> 24));
else if ((i & 0xffff) == 0)