diff options
author | Martynas Venckus <martynas@cvs.openbsd.org> | 2009-08-07 09:09:32 +0000 |
---|---|---|
committer | Martynas Venckus <martynas@cvs.openbsd.org> | 2009-08-07 09:09:32 +0000 |
commit | b46d1b25ca7421ac011630d34c4968e252a6d0ad (patch) | |
tree | 7decc56fe1c23fd0dee49a81c73b38b8717b2b8d /usr.bin | |
parent | 6c7f3a7f6f5ac6c8003af096990b5f9411fd1ff8 (diff) |
if buffers overlap; result will be undefined. ok claudio@, michele@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/netstat/show.c | 8 |
1 files changed, 4 insertions, 4 deletions
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 |