diff options
Diffstat (limited to 'usr.sbin/tcpdump/print-sunrpc.c')
| -rw-r--r-- | usr.sbin/tcpdump/print-sunrpc.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.sbin/tcpdump/print-sunrpc.c b/usr.sbin/tcpdump/print-sunrpc.c index 6d9b13e67ae..4235caed153 100644 --- a/usr.sbin/tcpdump/print-sunrpc.c +++ b/usr.sbin/tcpdump/print-sunrpc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-sunrpc.c,v 1.11 2001/11/06 03:11:40 deraadt Exp $ */ +/* $OpenBSD: print-sunrpc.c,v 1.12 2001/11/07 18:48:16 deraadt Exp $ */ /* * Copyright (c) 1992, 1993, 1994, 1995, 1996 @@ -23,7 +23,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /home/cvs/src/usr.sbin/tcpdump/print-sunrpc.c,v 1.11 2001/11/06 03:11:40 deraadt Exp $ (LBL)"; + "@(#) $Header: /home/cvs/src/usr.sbin/tcpdump/print-sunrpc.c,v 1.12 2001/11/07 18:48:16 deraadt Exp $ (LBL)"; #endif #include <sys/param.h> @@ -115,10 +115,8 @@ progstr(prog) return (buf); rp = getrpcbynumber(prog); if (rp == NULL) - (void) snprintf(buf, sizeof(buf), "#%u", prog); - else { - strncpy(buf, rp->r_name, sizeof buf-1); - buf[sizeof buf-1] = '\0'; - } + snprintf(buf, sizeof(buf), "#%u", prog); + else + strlcpy(buf, rp->r_name, sizeof(buf)); return (buf); } |
