wbokslag has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-tetra/+/41679?usp=email )


Change subject: Fix preventing crashes when -d missing
......................................................................

Fix preventing crashes when -d missing

Small fix that check whether a dumpdir was provided with -d. If not,
no voice data is written to file.

Change-Id: I6a857f62aae542b054cbb474594359da626762bb
---
M src/lower_mac/tetra_lower_mac.c
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-tetra refs/changes/79/41679/1

diff --git a/src/lower_mac/tetra_lower_mac.c b/src/lower_mac/tetra_lower_mac.c
index f8e7810..4775188 100644
--- a/src/lower_mac/tetra_lower_mac.c
+++ b/src/lower_mac/tetra_lower_mac.c
@@ -194,8 +194,8 @@
        if (tms->cur_burst.is_traffic && type == TPSAP_T_NDB && blk_num == 
BLK_1)
                tms->cur_burst.blk1_stolen = true;

-       /* If this is a traffic channel, dump. */
-       if (tms->cur_burst.is_traffic && (type == TPSAP_T_SCH_F || (blk_num == 
BLK_2 && !tms->cur_burst.blk2_stolen))) {
+       /* If this is a traffic channel and we have a dump output directory, 
dump. */
+       if (tms->cur_burst.is_traffic && (type == TPSAP_T_SCH_F || (blk_num == 
BLK_2 && !tms->cur_burst.blk2_stolen)) && tms->dumpdir) {
                char fname[PATH_MAX];
                int16_t block[690];
                FILE *f;

--
To view, visit https://gerrit.osmocom.org/c/osmo-tetra/+/41679?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: osmo-tetra
Gerrit-Branch: master
Gerrit-Change-Id: I6a857f62aae542b054cbb474594359da626762bb
Gerrit-Change-Number: 41679
Gerrit-PatchSet: 1
Gerrit-Owner: wbokslag <[email protected]>

Reply via email to