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 /sbin/route/show.c | |
parent | 6c7f3a7f6f5ac6c8003af096990b5f9411fd1ff8 (diff) |
if buffers overlap; result will be undefined. ok claudio@, michele@
Diffstat (limited to 'sbin/route/show.c')
-rw-r--r-- | sbin/route/show.c | 8 |
1 files changed, 4 insertions, 4 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 |