diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-02-28 11:45:32 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-02-28 19:55:21 +0000 |
commit | 03474c1303faeed68631e4074ba692bdc193323d (patch) | |
tree | 962b5b759f7bdd9c9a4a9127bd7a5fff0a8a26a7 /epan/dissectors/packet-dns.c | |
parent | d11f43a30e89dbeb56115824b9a1329b0d77f95e (diff) |
Redo the way we choose N/S/E/W.
This should squelch a warning from Visual Studio Code Analyzer.
Change-Id: Ie66e45276458a6f880c9b020ff541b7d2a71433a
Reviewed-on: https://code.wireshark.org/review/26184
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-dns.c')
-rw-r--r-- | epan/dissectors/packet-dns.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/epan/dissectors/packet-dns.c b/epan/dissectors/packet-dns.c index 5e45d04fe4..dd25c89cb1 100644 --- a/epan/dissectors/packet-dns.c +++ b/epan/dissectors/packet-dns.c @@ -1368,16 +1368,15 @@ rfc1867_angle(tvbuff_t *tvb, int offset, gboolean longitude) guint32 degrees, minutes, secs, tsecs; /* "%u deg %u min %u.%03u sec %c" */ static char buf[10+1+3+1 + 2+1+3+1 + 2+1+3+1+3+1 + 1 + 1]; - static char *nsew = "NSEW"; angle = tvb_get_ntohl(tvb, offset); if (angle < 0x80000000U) { angle = 0x80000000U - angle; - direction = nsew[1 + longitude ? 2 : 0]; + direction = longitude ? 'W' : 'S'; } else { angle = angle - 0x80000000U; - direction = nsew[longitude ? 2 : 0]; + direction = longitude ? 'E' : 'N'; } if (longitude ? (angle > 648000000) : (angle > 324000000)) |