aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/vty.c
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2019-10-18 09:27:03 +0200
committerOliver Smith <osmith@sysmocom.de>2019-10-21 11:08:50 +0200
commit583f2b86c9383dd6222bcabf05d312b53e02e3db (patch)
tree121b3f8f9806affa35d2205ecd4c8e231e5c4b4a /src/common/vty.c
parentfc5f20a713fd7e44e23db1dc61d9ebe7a1fd03b8 (diff)
vty.c: don't ignore get_string_value() errors
Change uint8_t sapi to int, so we can properly assert on errors from get_string_value(). Fixes: CID#205066, CID#205069 Change-Id: I4d30afacfab93051868ae8f462cee9ad3dbc7fd0
Diffstat (limited to 'src/common/vty.c')
-rw-r--r--src/common/vty.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/vty.c b/src/common/vty.c
index 865c236f..2e7a66d0 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -1603,11 +1603,11 @@ DEFUN(no_bts_t_t_l_loopback,
DEFUN(logging_fltr_l1_sapi, logging_fltr_l1_sapi_cmd, "HIDDEN", "HIDDEN")
{
- uint8_t sapi = get_string_value(l1sap_common_sapi_names, argv[0]);
+ int sapi = get_string_value(l1sap_common_sapi_names, argv[0]);
struct log_target *tgt = osmo_log_vty2tgt(vty);
uint16_t **sapi_mask;
- OSMO_ASSERT(sapi != -EINVAL);
+ OSMO_ASSERT(sapi < 0);
if (!tgt)
return CMD_WARNING;
@@ -1624,11 +1624,11 @@ DEFUN(logging_fltr_l1_sapi, logging_fltr_l1_sapi_cmd, "HIDDEN", "HIDDEN")
DEFUN(no_logging_fltr_l1_sapi, no_logging_fltr_l1_sapi_cmd, "HIDDEN", "HIDDEN")
{
- uint8_t sapi = get_string_value(l1sap_common_sapi_names, argv[0]);
+ int sapi = get_string_value(l1sap_common_sapi_names, argv[0]);
struct log_target *tgt = osmo_log_vty2tgt(vty);
uint16_t *sapi_mask;
- OSMO_ASSERT(sapi != -EINVAL);
+ OSMO_ASSERT(sapi < 0);
if (!tgt)
return CMD_WARNING;
if (!tgt->filter_data[LOG_FLT_L1_SAPI])