diff options
author | Harald Welte <laforge@osmocom.org> | 2019-11-24 18:54:02 +0100 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2019-11-24 18:56:12 +0100 |
commit | 3863beef260a58f692dd2d041a5547d3635c6e6b (patch) | |
tree | d711cb81985512ef780d3e90ef4b9a00974d0616 /src/e1cap_dump.c | |
parent | 645fa469678ef5ba9a6d8d3987964585f5c63ba3 (diff) |
e1cap_dump: fix superchannel without pcap output
We have to check if g_pcap_fd is >= 0,as we initialize it to -1.
Change-Id: I458c02b4619b6fb2c7d30b1ce3bbac86243a6977
Diffstat (limited to 'src/e1cap_dump.c')
-rw-r--r-- | src/e1cap_dump.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/e1cap_dump.c b/src/e1cap_dump.c index 027aa82..c172b55 100644 --- a/src/e1cap_dump.c +++ b/src/e1cap_dump.c @@ -78,7 +78,7 @@ static int all_bytes_are(unsigned char ch, const uint8_t *data, int len) static void handle_hdlc_frame_content(const uint8_t *data, unsigned int len, void *priv) { - if (g_pcap_fd && len >= 4) { + if (g_pcap_fd >= 0 && len >= 4) { uint8_t *cur = msgb_put(g_pcap_msg, len-2); memcpy(cur, data, len-2); printf("==> %s\n", msgb_hexdump(g_pcap_msg)); |