laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-e1-recorder/+/16187 )

Change subject: e1cap_dump: fix superchannel without pcap output
......................................................................

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
---
M src/e1cap_dump.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  pespin: Looks good to me, approved
  laforge: Verified



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

--
To view, visit https://gerrit.osmocom.org/c/osmo-e1-recorder/+/16187
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-e1-recorder
Gerrit-Branch: master
Gerrit-Change-Id: I458c02b4619b6fb2c7d30b1ce3bbac86243a6977
Gerrit-Change-Number: 16187
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to