summaryrefslogtreecommitdiff
path: root/print-gre.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-gre.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-gre.c')
-rw-r--r--print-gre.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/print-gre.c b/print-gre.c
index b4ad09a4..66a40f94 100644
--- a/print-gre.c
+++ b/print-gre.c
@@ -57,6 +57,8 @@ static const char rcsid[] _U_ =
#include "ip.h"
#include "ethertype.h"
+static const char tstr[] = "[|gre]";
+
#define GRE_CP 0x8000 /* checksum present */
#define GRE_RP 0x4000 /* routing present */
#define GRE_KP 0x2000 /* key present */
@@ -94,7 +96,7 @@ gre_print(const u_char *bp, u_int length)
u_int len = length, vers;
if (len < 2) {
- printf("[|gre]");
+ printf("%s", tstr);
return;
}
vers = EXTRACT_16BITS(bp) & GRE_VERS_MASK;
@@ -234,7 +236,7 @@ gre_print_0(const u_char *bp, u_int length)
return;
trunc:
- printf("[|gre]");
+ printf("%s", tstr);
}
void
@@ -314,7 +316,7 @@ gre_print_1(const u_char *bp, u_int length)
return;
trunc:
- printf("[|gre]");
+ printf("%s", tstr);
}
void