summaryrefslogtreecommitdiff
path: root/print-atm.c
diff options
context:
space:
mode:
authorDenis Ovsienko <infrastation@yandex.ru>2013-12-26 18:08:06 +0400
committerDenis Ovsienko <infrastation@yandex.ru>2013-12-26 18:19:50 +0400
commitd8acd8f5d0d7cac4881b5552eca5dc40a5d3c0d1 (patch)
tree5aeac16d418b595a76270d00a2cfb12ebcd31c6c /print-atm.c
parentae1fdebb647a437fbec8d3d4845da190da180dd8 (diff)
downloadtcpdump-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-atm.c')
-rw-r--r--print-atm.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/print-atm.c b/print-atm.c
index b132a6de..0327b0d4 100644
--- a/print-atm.c
+++ b/print-atm.c
@@ -43,6 +43,8 @@ static const char rcsid[] _U_ =
#include "ether.h"
+static const char tstr[] = "[|atm]";
+
#define OAM_CRC10_MASK 0x3ff
#define OAM_PAYLOAD_LEN 48
#define OAM_FUNCTION_SPECIFIC_LEN 45 /* this excludes crc10 and cell-type/function-type */
@@ -172,7 +174,7 @@ atm_if_print(const struct pcap_pkthdr *h, const u_char *p)
u_int hdrlen = 0;
if (caplen < 8) {
- printf("[|atm]");
+ printf("%s", tstr);
return (caplen);
}
@@ -254,7 +256,7 @@ sig_print(const u_char *p, int caplen)
bpf_u_int32 call_ref;
if (caplen < PROTO_POS) {
- printf("[|atm]");
+ printf("%s", tstr);
return;
}
if (p[PROTO_POS] == Q2931) {
@@ -264,7 +266,7 @@ sig_print(const u_char *p, int caplen)
*/
printf("Q.2931");
if (caplen < MSG_TYPE_POS) {
- printf(" [|atm]");
+ printf(" %s", tstr);
return;
}
printf(":%s ",