diff options
author | Gisle Vanem <gvanem@broadpark.no> | 2013-07-03 20:47:50 +0400 |
---|---|---|
committer | Denis Ovsienko <infrastation@yandex.ru> | 2013-07-03 20:47:50 +0400 |
commit | 5eb92dbce1672327bf3cf2b7269c19d178a569a7 (patch) | |
tree | b1ffa61586c69b15a7fc87f09cb6a12a5b5fddb6 /print-geonet.c | |
parent | 9a68bf303ada7a69d853eeefa09634a5a077e48e (diff) | |
download | tcpdump-5eb92dbce1672327bf3cf2b7269c19d178a569a7.tar.gz |
CALM FAST/GeoNet: fix Windows compile errors
It didn't work out-of-the box because my MSVC (v16 from Visual C
Express 2010) isn't a C99 compiler; you cannot have code ahead of
declarations.
Diffstat (limited to 'print-geonet.c')
-rw-r--r-- | print-geonet.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/print-geonet.c b/print-geonet.c index 7cc06229..dd1d6bd7 100644 --- a/print-geonet.c +++ b/print-geonet.c @@ -58,14 +58,18 @@ static const struct tok msg_type_values[] = { static void print_btp_body(const u_char *bp, u_int length) { + int version; + int msg_type; + const char *msg_type_str; + if (length <= 2) { return; } // Assuming ItsDpuHeader - int version = bp[0]; - int msg_type = bp[1]; - const char *msg_type_str = tok2str(msg_type_values, "unknown (%u)", msg_type); + version = bp[0]; + msg_type = bp[1]; + msg_type_str = tok2str(msg_type_values, "unknown (%u)", msg_type); printf("; ItsPduHeader v:%d t:%d-%s", version, msg_type, msg_type_str); } |