diff options
author | Denis Ovsienko <infrastation@yandex.ru> | 2013-12-26 18:08:06 +0400 |
---|---|---|
committer | Denis Ovsienko <infrastation@yandex.ru> | 2013-12-26 18:19:50 +0400 |
commit | d8acd8f5d0d7cac4881b5552eca5dc40a5d3c0d1 (patch) | |
tree | 5aeac16d418b595a76270d00a2cfb12ebcd31c6c /print-sl.c | |
parent | ae1fdebb647a437fbec8d3d4845da190da180dd8 (diff) | |
download | tcpdump-d8acd8f5d0d7cac4881b5552eca5dc40a5d3c0d1.tar.gz |
make consistent use of the "tstr" idiom
For each decoder that has more than one instance of truncation signaling
and prints the same string in each instance make sure that the string is
declared as "static const char tstr[]" right after the initial includes
block. Where necessary, replace fputs(s, stdout) with equivalent
printf("%s", s).
Diffstat (limited to 'print-sl.c')
-rw-r--r-- | print-sl.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -42,6 +42,8 @@ static const char rcsid[] _U_ = #include "slip.h" #include "slcompress.h" +static const char tstr[] = "[|slip]"; + static u_int lastlen[2][256]; static u_int lastconn = 255; @@ -56,7 +58,7 @@ sl_if_print(const struct pcap_pkthdr *h, const u_char *p) register const struct ip *ip; if (caplen < SLIP_HDRLEN) { - printf("[|slip]"); + printf("%s", tstr); return (caplen); } @@ -91,7 +93,7 @@ sl_bsdos_if_print(const struct pcap_pkthdr *h, const u_char *p) register const struct ip *ip; if (caplen < SLIP_HDRLEN) { - printf("[|slip]"); + printf("%s", tstr); return (caplen); } |