gsm_trx_name(): don't break if trx is NULL

Just as a general precaution deemed to fit such a convenience function that
lives in libcommon, no actual failure observed.

Change-Id: I8e77fe1abc402469fd037e2fde2f46e2c8114f59
This commit is contained in:
Neels Hofmeyr 2016-10-10 03:26:34 +02:00
parent a6ba6a370b
commit 756fb30c8a
1 changed files with 5 additions and 2 deletions

View File

@ -328,8 +328,11 @@ static char ts2str[255];
char *gsm_trx_name(const struct gsm_bts_trx *trx)
{
snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d)",
trx->bts->nr, trx->nr);
if (!trx)
snprintf(ts2str, sizeof(ts2str), "(trx=NULL)");
else
snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d)",
trx->bts->nr, trx->nr);
return ts2str;
}