From f46067977ae085503297c894cf86a674f2772d62 Mon Sep 17 00:00:00 2001 From: Michael Black Date: Tue, 10 Mar 2020 08:43:42 -0500 Subject: [PATCH] Fix rotctl set_conf --- src/rot_conf.c | 6 +++++- tests/rotctl_parse.c | 12 ++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/rot_conf.c b/src/rot_conf.c index 224c7f985..2f5c50fbd 100644 --- a/src/rot_conf.c +++ b/src/rot_conf.c @@ -543,7 +543,7 @@ const struct confparams *HAMLIB_API rot_confparam_lookup(ROT *rot, const struct confparams *cfp; token_t token; - rot_debug(RIG_DEBUG_VERBOSE, "%s called lookup=%s\n", __func__, name); + //rot_debug(RIG_DEBUG_VERBOSE, "%s called lookup=%s\n", __func__, name); if (!rot || !rot->caps) { @@ -553,16 +553,20 @@ const struct confparams *HAMLIB_API rot_confparam_lookup(ROT *rot, /* 0 returned for invalid format */ token = strtol(name, NULL, 0); + //rig_debug(RIG_DEBUG_TRACE, "%s: token=%d\n", __func__, (int)token); for (cfp = rot->caps->cfgparams; cfp && cfp->name; cfp++) { + //rig_debug(RIG_DEBUG_TRACE, "%s: name=%s cfp->name=%s cfp->token=%d, token=%d\n", __func__, name, cfp->name, (int)cfp->token, (int)token); if (!strcmp(cfp->name, name) || token == cfp->token) { return cfp; } } + //rig_debug(RIG_DEBUG_TRACE, "%s: frontend check\n", __func__); for (cfp = rotfrontend_cfg_params; cfp->name; cfp++) { + //rig_debug(RIG_DEBUG_TRACE, "%s: name=%s cfp->name=%s cfp->token=%d, token=%d\n", __func__, name, cfp->name, (int)cfp->token, (int)token); if (!strcmp(cfp->name, name) || token == cfp->token) { return cfp; diff --git a/tests/rotctl_parse.c b/tests/rotctl_parse.c index 797583195..3805a9f33 100644 --- a/tests/rotctl_parse.c +++ b/tests/rotctl_parse.c @@ -1653,14 +1653,14 @@ int set_conf(ROT *my_rot, char *conf_parms) if (!q) { return RIG_EINVAL; + } - *q++ = '\0'; - n = strchr(q, ','); + *q++ = '\0'; + n = strchr(q, ','); - if (n) - { - *n++ = '\0'; - } + if (n) + { + *n++ = '\0'; } rig_debug(RIG_DEBUG_TRACE, "%s: token=%s, val=%s\n", __func__, p, q);