diff options
author | Guy Harris <gharris@sonic.net> | 2020-06-02 15:50:58 -0700 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2020-06-02 23:19:29 +0000 |
commit | 86eba21b8231107f3bd559d7bea6fbde4ee56e0f (patch) | |
tree | 319d464b4937106e9f1f6ea87d830e1893b6541f /wiretap | |
parent | 7f9f781d3270faa1382e9fb91cbab25edd14280e (diff) |
Squelch a Coverity warning.
I guess Coverity gets upset because, the way GUINT32_TO_BE() works when
building with Coverity, there's at least one test done the result of
which is always the same.
Calculate the "native" value of the direction, and then put it into
big-endian order, in two separate statements.
This should squelch Coverity CID 1457345.
Change-Id: I1ccd6fd848e6abc91f16fa375c98efcab9c5bf60
Reviewed-on: https://code.wireshark.org/review/37370
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/pcap-common.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/wiretap/pcap-common.c b/wiretap/pcap-common.c index 4c683595a1..f8d60caf35 100644 --- a/wiretap/pcap-common.c +++ b/wiretap/pcap-common.c @@ -1242,9 +1242,11 @@ static gboolean pcap_write_bt_pseudoheader(wtap_dumper *wdh, const union wtap_pseudo_header *pseudo_header, int *err) { + guint32 direction; struct pcap_bt_phdr bt_hdr; - bt_hdr.direction = GUINT32_TO_BE(pseudo_header->p2p.sent ? LIBPCAP_BT_PHDR_SENT : LIBPCAP_BT_PHDR_RECV); + direction = pseudo_header->p2p.sent ? LIBPCAP_BT_PHDR_SENT : LIBPCAP_BT_PHDR_RECV; + bt_hdr.direction = GUINT32_TO_BE(direction); if (!wtap_dump_file_write(wdh, &bt_hdr, sizeof bt_hdr, err)) return FALSE; wdh->bytes_dumped += sizeof bt_hdr; |