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-arp.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-arp.c')
| -rw-r--r-- | print-arp.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/print-arp.c b/print-arp.c index b5047a0d..e53c58ca 100644 --- a/print-arp.c +++ b/print-arp.c @@ -39,6 +39,8 @@ static const char rcsid[] _U_ = #include "ethertype.h" #include "extract.h" /* must come after interface.h */ +static const char tstr[] = "[|ARP]"; + /* * Address Resolution Protocol. * @@ -211,7 +213,7 @@ atmarp_print(netdissect_options *ndo, op = ATMOP(ap); if (!ND_TTEST2(*aar_tpa(ap), ATMTPROTO_LEN(ap))) { - ND_PRINT((ndo, "[|ARP]")); + ND_PRINT((ndo, "%s", tstr)); ND_DEFAULTPRINT((const u_char *)ap, length); return; } @@ -289,7 +291,7 @@ atmarp_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "[|ARP]")); + ND_PRINT((ndo, "%s", tstr)); } void @@ -325,7 +327,7 @@ arp_print(netdissect_options *ndo, } if (!ND_TTEST2(*ar_tpa(ap), PROTO_LEN(ap))) { - ND_PRINT((ndo, "[|ARP]")); + ND_PRINT((ndo, "%s", tstr)); ND_DEFAULTPRINT((const u_char *)ap, length); return; } @@ -406,7 +408,7 @@ arp_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "[|ARP]")); + ND_PRINT((ndo, "%s", tstr)); } /* |
