diff options
Diffstat (limited to 'src/vty/tdef_vty.c')
-rw-r--r-- | src/vty/tdef_vty.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/vty/tdef_vty.c b/src/vty/tdef_vty.c index fe6d48ba..bd209ae0 100644 --- a/src/vty/tdef_vty.c +++ b/src/vty/tdef_vty.c @@ -50,10 +50,9 @@ */ struct osmo_tdef *osmo_tdef_vty_parse_T_arg(struct vty *vty, struct osmo_tdef *tdefs, const char *T_str) { - long l; + int l; int T; struct osmo_tdef *t; - char *endptr; const char *T_nr_str; int sign = 1; @@ -77,9 +76,7 @@ struct osmo_tdef *osmo_tdef_vty_parse_T_arg(struct vty *vty, struct osmo_tdef *t return NULL; } - errno = 0; - l = strtol(T_nr_str, &endptr, 10); - if (errno || *endptr || l > INT_MAX || l < 0) { + if (osmo_str_to_int(&l, T_nr_str, 10, 0, INT_MAX)) { vty_out(vty, "%% Invalid T timer argument (should be 'T1234' or 'X1234'): '%s'%s", T_str, VTY_NEWLINE); return NULL; } @@ -245,7 +242,7 @@ void osmo_tdef_vty_out_all(struct vty *vty, struct osmo_tdef *tdefs, const char /*! Write current timer configuration arguments to the vty. Skip all entries that reflect their default value. * The passed prefix string must contain both necessary indent and the VTY command the specific implementation is using. - * See tdef_vty_test_config_subnode.c and tdef_vty_test_dynamic.c for examples. + * See tdef_vty_config_subnode_test.c and tdef_vty_dynamic_test.c for examples. * \param[in] vty VTY context. * \param[in] tdefs Array of timers to print, ended with a fully zero-initialized entry. * \param[in] prefix_fmt Arbitrary string to start each line with, with variable printf like arguments. @@ -379,8 +376,8 @@ void osmo_tdef_vty_groups_init(unsigned int parent_cfg_node, struct osmo_tdef_gr cfg_timer_cmd.string = timer_command_string("timer", OSMO_TDEF_VTY_ARG_SET_OPTIONAL); cfg_timer_cmd.doc = timer_doc_string("Configure or show timers\n", OSMO_TDEF_VTY_DOC_SET); - install_element_ve(&show_timer_cmd); - install_element(parent_cfg_node, &cfg_timer_cmd); + install_lib_element_ve(&show_timer_cmd); + install_lib_element(parent_cfg_node, &cfg_timer_cmd); } /*! Write the global osmo_tdef_group configuration to VTY, as previously passed to osmo_tdef_vty_groups_init(). |