X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/c8a718a919f0ea88aea525ae4757bca6aac2dc4d..bfadcfe91ffc2584d00b6a9def079fa1e6b5cdfc:/util.c diff --git a/util.c b/util.c index 088c14e7..005824e3 100644 --- a/util.c +++ b/util.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/util.c,v 1.87.2.2 2003-11-16 08:51:58 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/util.c,v 1.87.2.4 2004-04-28 22:09:23 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -199,27 +199,9 @@ relts_print(int secs) */ int -print_unknown_data(const u_char *cp,const char *lf,int len) +print_unknown_data(const u_char *cp,const char *ident,int len) { - int i; - - if (len ==0) - return(0); - - printf("%s0x0000: ",lf); - for(i=0;is != NULL) { if (lp->v == v) @@ -239,8 +223,10 @@ tok2str(register const struct tok *lp, register const char *fmt, } if (fmt == NULL) fmt = "#%d"; - (void)snprintf(buf, sizeof(buf), fmt, v); - return (buf); + ret = buf[idx]; + (void)snprintf(ret, sizeof(buf[0]), fmt, v); + idx = (idx+1) & 3; + return (ret); } /*