X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/dff10c7f70d539c431a1eba9ab5e076d8b0f5c8e..153e205db74c3bc57d40c5118dbaedefc210ba07:/print-decnet.c diff --git a/print-decnet.c b/print-decnet.c index 4c290f9e..f83173cb 100644 --- a/print-decnet.c +++ b/print-decnet.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-decnet.c,v 1.28 2000-01-17 06:24:24 itojun Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-decnet.c,v 1.33 2001-09-17 21:57:59 fenner Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -32,20 +32,14 @@ static const char rcsid[] = #include #include -#if __STDC__ struct mbuf; struct rtentry; -#endif -#include #ifdef HAVE_LIBDNET #include #endif #include -#ifdef HAVE_MALLOC_H -#include -#endif #include #include #include @@ -736,7 +730,7 @@ print_reason(register int reason) printf("%s ", tok2str(reason2str, "reason-%d", reason)); } -char * +const char * dnnum_string(u_short dnaddr) { char *str; @@ -751,7 +745,7 @@ dnnum_string(u_short dnaddr) return(str); } -char * +const char * dnname_string(u_short dnaddr) { #ifdef HAVE_LIBDNET @@ -759,7 +753,7 @@ dnname_string(u_short dnaddr) dna.a_len = sizeof(short); memcpy((char *)dna.a_addr, (char *)&dnaddr, sizeof(short)); - return (savestr(dnet_htoa(&dna))); + return (strdup(dnet_htoa(&dna))); #else return(dnnum_string(dnaddr)); /* punt */ #endif @@ -774,10 +768,7 @@ pdata(u_char *dp, u_int maxlen) while (x-- > 0) { c = *dp++; - if (isprint(c)) - putchar(c); - else - printf("\\%o", c & 0xFF); + safeputchar(c); } } #endif