handover_test: fix ts_str may be uninitialized

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
This commit is contained in:
Oliver Smith 2021-07-12 10:28:35 +02:00
parent 5ac7075643
commit e0c62bb9bd
1 changed files with 2 additions and 2 deletions

View File

@ -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 '-':