aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2021-07-12 10:28:35 +0200
committerOliver Smith <osmith@sysmocom.de>2021-07-12 10:28:35 +0200
commite0c62bb9bdf8b110679979febca401cbc5f34311 (patch)
tree827b29a9f203cbfd6c5073592df4bb170ad37924
parent5ac70756435213783c5f6896d17d1b55ba17286c (diff)
handover_test: fix ts_str may be uninitializedosmith/build-fix
Fix for: handover_test.c: In function 'res_ind': handover_test.c:1094:30: error: 'ts_str' may be used uninitialized in this function [-Werror=maybe-uninitialized] char subslot_val = ts_str[lchan->nr]; Fixes: f76424 ("RES IND: add test_resource_indication.ho_vty") Change-Id: I398ba24b945bad96896eeb5ddbaff9c48bacf8ab
-rw-r--r--tests/handover/handover_test.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index 8d316ca8e..2c97f782a 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -1077,7 +1077,7 @@ DEFUN(res_ind, res_ind_cmd,
level = 0xff;
for (i = 0; i < ARRAY_SIZE(trx->ts); i++) {
- const char *ts_str;
+ const char *ts_str = NULL;
struct gsm_lchan *lchan;
size_t given_subslots = 0;
struct gsm_bts_trx_ts *ts = &trx->ts[i];
@@ -1090,7 +1090,7 @@ DEFUN(res_ind, res_ind_cmd,
ts_for_n_lchans(lchan, ts, ts->max_lchans_possible) {
int chan_nr;
- if (lchan->nr < given_subslots) {
+ if (lchan->nr < given_subslots && ts_str) {
char subslot_val = ts_str[lchan->nr];
switch (subslot_val) {
case '-':