diff options
-rw-r--r-- | sbin/route/show.c | 8 | ||||
-rw-r--r-- | usr.bin/netstat/show.c | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/sbin/route/show.c b/sbin/route/show.c index 9ccb0662ccd..60cd4cc477a 100644 --- a/sbin/route/show.c +++ b/sbin/route/show.c @@ -1,4 +1,4 @@ -/* $OpenBSD: show.c,v 1.80 2009/06/27 11:35:57 michele Exp $ */ +/* $OpenBSD: show.c,v 1.81 2009/08/07 09:09:31 martynas Exp $ */ /* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */ /* @@ -546,7 +546,7 @@ static char domain[MAXHOSTNAMELEN]; void p_sockaddr_mpls(struct sockaddr *in, struct sockaddr *out, int flags, int width) { - char *cp; + char buf[MAXHOSTNAMELEN], *cp; if (in->sa_family != AF_MPLS) return; @@ -556,10 +556,10 @@ p_sockaddr_mpls(struct sockaddr *in, struct sockaddr *out, int flags, int width) else cp = label_print(in, out); - snprintf(cp, MAXHOSTNAMELEN, "%s %s", cp, + snprintf(buf, MAXHOSTNAMELEN, "%s %s", cp, label_print_op(flags)); - printf("%-*s ", width, cp); + printf("%-*s ", width, buf); } void diff --git a/usr.bin/netstat/show.c b/usr.bin/netstat/show.c index 43a0e39eeb0..f1db27e0da3 100644 --- a/usr.bin/netstat/show.c +++ b/usr.bin/netstat/show.c @@ -1,4 +1,4 @@ -/* $OpenBSD: show.c,v 1.26 2009/08/05 03:26:59 deraadt Exp $ */ +/* $OpenBSD: show.c,v 1.27 2009/08/07 09:09:31 martynas Exp $ */ /* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */ /* @@ -554,7 +554,7 @@ static char domain[MAXHOSTNAMELEN]; void p_sockaddr_mpls(struct sockaddr *in, struct sockaddr *out, int flags, int width) { - char *cp; + char buf[MAXHOSTNAMELEN], *cp; if (in->sa_family != AF_MPLS) return; @@ -564,10 +564,10 @@ p_sockaddr_mpls(struct sockaddr *in, struct sockaddr *out, int flags, int width) else cp = label_print(in, out); - snprintf(cp, MAXHOSTNAMELEN, "%s %s", cp, + snprintf(buf, MAXHOSTNAMELEN, "%s %s", cp, label_print_op(flags)); - printf("%-*s ", width, cp); + printf("%-*s ", width, buf); } void |