From 7a5834a9a370c37e76302b2bd438602edc2128dc Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Wed, 1 Sep 2021 09:11:00 -0500 Subject: [PATCH] Fix bogus sscanf in kpa_get_powerstat -- function would not work --- amplifiers/elecraft/kpa.c | 4 +++- amplifiers/elecraft/kpa1500.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/amplifiers/elecraft/kpa.c b/amplifiers/elecraft/kpa.c index dc066de61..fa0ed55af 100644 --- a/amplifiers/elecraft/kpa.c +++ b/amplifiers/elecraft/kpa.c @@ -505,7 +505,7 @@ int kpa_get_powerstat(AMP *amp, powerstat_t *status) int retval; int operate; int ampon; - int nargs = sscanf(responsebuf, "^ON%d", &on); + int nargs; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -518,6 +518,8 @@ int kpa_get_powerstat(AMP *amp, powerstat_t *status) if (retval != RIG_OK) { return retval; } + nargs = sscanf(responsebuf, "^ON%d", &on); + if (nargs != 1) { rig_debug(RIG_DEBUG_VERBOSE, "%s Error: ^ON response='%s'\n", __func__, diff --git a/amplifiers/elecraft/kpa1500.c b/amplifiers/elecraft/kpa1500.c index 65724a4f4..ea3b27750 100644 --- a/amplifiers/elecraft/kpa1500.c +++ b/amplifiers/elecraft/kpa1500.c @@ -65,7 +65,7 @@ const struct amp_caps kpa1500_amp_caps = AMP_MODEL(AMP_MODEL_ELECRAFT_KPA1500), .model_name = "KPA1500", .mfg_name = "Elecraft", - .version = "20200112.0", + .version = "20210901.0", .copyright = "LGPL", .status = RIG_STATUS_ALPHA, .amp_type = AMP_TYPE_OTHER,