From b0ae08f7b7ed43f3df33354131b9defc3237d5b8 Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Mon, 10 Jan 2022 17:22:33 -0600 Subject: [PATCH] Change rig_get_conf to rig_get_conf2 in Yaesu rigs --- rigs/yaesu/ft100.c | 2 +- rigs/yaesu/ft1200.c | 2 +- rigs/yaesu/ft2000.c | 2 +- rigs/yaesu/ft3000.c | 2 +- rigs/yaesu/ft450.c | 2 +- rigs/yaesu/ft5000.c | 2 +- rigs/yaesu/ft757gx.c | 2 +- rigs/yaesu/ft9000.c | 2 +- rigs/yaesu/ft950.c | 2 +- rigs/yaesu/ftdx10.c | 2 +- rigs/yaesu/ftdx101.c | 2 +- rigs/yaesu/ftdx101mp.c | 2 +- rigs/yaesu/newcat.c | 4 ++-- rigs/yaesu/newcat.h | 3 ++- 14 files changed, 16 insertions(+), 15 deletions(-) diff --git a/rigs/yaesu/ft100.c b/rigs/yaesu/ft100.c index 6c18e1e4b..a0bba9fc6 100644 --- a/rigs/yaesu/ft100.c +++ b/rigs/yaesu/ft100.c @@ -636,7 +636,7 @@ int ft100_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) /* now convert it .... */ - sprintf(freq_str, "%02X%02X%02X%02X", + SNPRINTF(freq_str, sizeof(freq_str), "%02X%02X%02X%02X", priv->status.freq[0], priv->status.freq[1], priv->status.freq[2], diff --git a/rigs/yaesu/ft1200.c b/rigs/yaesu/ft1200.c index 5df3c2fe5..38377fc9a 100644 --- a/rigs/yaesu/ft1200.c +++ b/rigs/yaesu/ft1200.c @@ -274,7 +274,7 @@ const struct rig_caps ftdx1200_caps = .cfgparams = newcat_cfg_params, .set_conf = newcat_set_conf, - .get_conf = newcat_get_conf, + .get_conf2 = newcat_get_conf2, .set_freq = newcat_set_freq, .get_freq = newcat_get_freq, .set_mode = newcat_set_mode, diff --git a/rigs/yaesu/ft2000.c b/rigs/yaesu/ft2000.c index 7b1e6f6c9..52e57867b 100644 --- a/rigs/yaesu/ft2000.c +++ b/rigs/yaesu/ft2000.c @@ -263,7 +263,7 @@ const struct rig_caps ft2000_caps = .cfgparams = newcat_cfg_params, .set_conf = newcat_set_conf, - .get_conf = newcat_get_conf, + .get_conf2 = newcat_get_conf2, .set_freq = newcat_set_freq, .get_freq = newcat_get_freq, .set_mode = newcat_set_mode, diff --git a/rigs/yaesu/ft3000.c b/rigs/yaesu/ft3000.c index d2e590e3f..9f94c5497 100644 --- a/rigs/yaesu/ft3000.c +++ b/rigs/yaesu/ft3000.c @@ -367,7 +367,7 @@ const struct rig_caps ftdx3000_caps = .cfgparams = newcat_cfg_params, .set_conf = newcat_set_conf, - .get_conf = newcat_get_conf, + .get_conf2 = newcat_get_conf2, .set_freq = newcat_set_freq, .get_freq = newcat_get_freq, .set_mode = newcat_set_mode, diff --git a/rigs/yaesu/ft450.c b/rigs/yaesu/ft450.c index 267688912..542ee470d 100644 --- a/rigs/yaesu/ft450.c +++ b/rigs/yaesu/ft450.c @@ -162,7 +162,7 @@ const struct rig_caps ft450_caps = .cfgparams = newcat_cfg_params, .set_conf = newcat_set_conf, - .get_conf = newcat_get_conf, + .get_conf2 = newcat_get_conf2, .set_freq = newcat_set_freq, .get_freq = newcat_get_freq, .set_mode = newcat_set_mode, diff --git a/rigs/yaesu/ft5000.c b/rigs/yaesu/ft5000.c index 0d7ca31fb..81e255ea6 100644 --- a/rigs/yaesu/ft5000.c +++ b/rigs/yaesu/ft5000.c @@ -263,7 +263,7 @@ const struct rig_caps ftdx5000_caps = .cfgparams = newcat_cfg_params, .set_conf = newcat_set_conf, - .get_conf = newcat_get_conf, + .get_conf2 = newcat_get_conf2, .set_freq = newcat_set_freq, .get_freq = newcat_get_freq, .set_mode = newcat_set_mode, diff --git a/rigs/yaesu/ft757gx.c b/rigs/yaesu/ft757gx.c index 165ce7bc0..6179100c5 100644 --- a/rigs/yaesu/ft757gx.c +++ b/rigs/yaesu/ft757gx.c @@ -888,7 +888,7 @@ static int ft757gx_get_conf(RIG *rig, token_t token, char *val) switch (token) { case TOK_FAKEFREQ: - sprintf(val, "%d", priv->fakefreq); + SNPRINTF(val, sizeof(val), "%d", priv->fakefreq); break; default: diff --git a/rigs/yaesu/ft9000.c b/rigs/yaesu/ft9000.c index 99e85c444..0e9f05f52 100644 --- a/rigs/yaesu/ft9000.c +++ b/rigs/yaesu/ft9000.c @@ -170,7 +170,7 @@ const struct rig_caps ft9000_caps = .cfgparams = newcat_cfg_params, .set_conf = newcat_set_conf, - .get_conf = newcat_get_conf, + .get_conf2 = newcat_get_conf2, .set_freq = newcat_set_freq, .get_freq = newcat_get_freq, .set_mode = newcat_set_mode, diff --git a/rigs/yaesu/ft950.c b/rigs/yaesu/ft950.c index 95dad2662..a88ed4698 100644 --- a/rigs/yaesu/ft950.c +++ b/rigs/yaesu/ft950.c @@ -238,7 +238,7 @@ const struct rig_caps ft950_caps = .cfgparams = newcat_cfg_params, .set_conf = newcat_set_conf, - .get_conf = newcat_get_conf, + .get_conf2 = newcat_get_conf2, .set_freq = newcat_set_freq, .get_freq = newcat_get_freq, .set_mode = newcat_set_mode, diff --git a/rigs/yaesu/ftdx10.c b/rigs/yaesu/ftdx10.c index 41738e4cb..3e181fa79 100644 --- a/rigs/yaesu/ftdx10.c +++ b/rigs/yaesu/ftdx10.c @@ -262,7 +262,7 @@ const struct rig_caps ftdx10_caps = .cfgparams = newcat_cfg_params, .set_conf = newcat_set_conf, - .get_conf = newcat_get_conf, + .get_conf2 = newcat_get_conf2, .set_freq = newcat_set_freq, .get_freq = newcat_get_freq, .set_mode = newcat_set_mode, diff --git a/rigs/yaesu/ftdx101.c b/rigs/yaesu/ftdx101.c index 00ca222ff..bbf6eaa65 100644 --- a/rigs/yaesu/ftdx101.c +++ b/rigs/yaesu/ftdx101.c @@ -263,7 +263,7 @@ const struct rig_caps ftdx101d_caps = .cfgparams = newcat_cfg_params, .set_conf = newcat_set_conf, - .get_conf = newcat_get_conf, + .get_conf2 = newcat_get_conf2, .set_freq = newcat_set_freq, .get_freq = newcat_get_freq, .set_mode = newcat_set_mode, diff --git a/rigs/yaesu/ftdx101mp.c b/rigs/yaesu/ftdx101mp.c index 4fbcebfb1..07ba2024d 100644 --- a/rigs/yaesu/ftdx101mp.c +++ b/rigs/yaesu/ftdx101mp.c @@ -201,7 +201,7 @@ const struct rig_caps ftdx101mp_caps = .cfgparams = newcat_cfg_params, .set_conf = newcat_set_conf, - .get_conf = newcat_get_conf, + .get_conf2 = newcat_get_conf2, .set_freq = newcat_set_freq, .get_freq = newcat_get_freq, .set_mode = newcat_set_mode, diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index a73e59a5d..d94054273 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -679,7 +679,7 @@ int newcat_set_conf(RIG *rig, token_t token, const char *val) * Get Configuration Token for Yaesu Radios */ -int newcat_get_conf(RIG *rig, token_t token, char *val) +int newcat_get_conf2(RIG *rig, token_t token, char *val, int val_len) { int ret = RIG_OK; struct newcat_priv_data *priv; @@ -701,7 +701,7 @@ int newcat_get_conf(RIG *rig, token_t token, char *val) RETURNFUNC(-RIG_ENOMEM); } - sprintf(val, "%d", priv->fast_set_commands); + SNPRINTF(val, val_len, "%d", priv->fast_set_commands); break; default: diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 9fe9023e2..ee68caf41 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20211227" +#define NEWCAT_VER "20220110" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 @@ -160,6 +160,7 @@ int newcat_close(RIG *rig); int newcat_set_conf(RIG *rig, token_t token, const char *val); int newcat_get_conf(RIG *rig, token_t token, char *val); +int newcat_get_conf2(RIG *rig, token_t token, char *val, int val_len); int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq); int newcat_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);