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>
This commit is contained in:
Guy Harris 2018-02-28 11:45:32 -08:00
parent d11f43a30e
commit 03474c1303
1 changed files with 2 additions and 3 deletions

View File

@ -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))