X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/7cf1b02275833ba76c7a718debad764575ef5791..bfadcfe91ffc2584d00b6a9def079fa1e6b5cdfc:/util.c diff --git a/util.c b/util.c index eef798b3..005824e3 100644 --- a/util.c +++ b/util.c @@ -19,6 +19,10 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ +#ifndef lint +static const char rcsid[] _U_ = + "@(#) $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 #include "config.h" @@ -40,10 +44,6 @@ #include "interface.h" -#ifndef lint -static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/util.c,v 1.87.2.1 2003-11-15 22:29:19 guy Exp $ (LBL)"; -#endif /* * Print out a filename (or other ascii string). * If ep is NULL, assume no truncation check is needed. @@ -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); } /*