From f97714c3145c42a59a2c94049656f5fe494ed9c4 Mon Sep 17 00:00:00 2001 From: Michael Black Date: Mon, 13 Jan 2020 15:19:46 -0600 Subject: [PATCH] Fix cppcheck warning in xg3.c --- kenwood/xg3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kenwood/xg3.c b/kenwood/xg3.c index 73e596f15..86ea4c3c0 100644 --- a/kenwood/xg3.c +++ b/kenwood/xg3.c @@ -506,7 +506,6 @@ int xg3_set_powerstat(RIG *rig, powerstat_t status) int xg3_get_powerstat(RIG *rig, powerstat_t *status) { const char *cmd = "G"; // any command to test will do - char reply[32]; int retval = kenwood_transaction(rig, cmd, NULL, 0); struct rig_state *rs = &rig->state; struct xg3_priv_data *priv = (struct xg3_priv_data *)rig->state.priv; @@ -515,12 +514,13 @@ int xg3_get_powerstat(RIG *rig, powerstat_t *status) if (retval == RIG_OK) { + char reply[32]; retval = read_string(&rs->rigport, reply, sizeof(reply), ";", 1); *status = RIG_POWER_ON; priv->powerstat = RIG_POWER_ON; } - else if (retval != RIG_OK) + if (retval != RIG_OK) { *status = RIG_POWER_OFF; // Error indicates power is off rig_debug(RIG_DEBUG_VERBOSE, "%s read_string failed\n", __func__);