Fix cppcheck warning in xg3.c

pull/174/head
Michael Black 2020-01-13 15:19:46 -06:00
rodzic dc92ae7843
commit f97714c314
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6599353EC683404D
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -506,7 +506,6 @@ int xg3_set_powerstat(RIG *rig, powerstat_t status)
int xg3_get_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 const char *cmd = "G"; // any command to test will do
char reply[32];
int retval = kenwood_transaction(rig, cmd, NULL, 0); int retval = kenwood_transaction(rig, cmd, NULL, 0);
struct rig_state *rs = &rig->state; struct rig_state *rs = &rig->state;
struct xg3_priv_data *priv = (struct xg3_priv_data *)rig->state.priv; 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) if (retval == RIG_OK)
{ {
char reply[32];
retval = read_string(&rs->rigport, reply, sizeof(reply), ";", 1); retval = read_string(&rs->rigport, reply, sizeof(reply), ";", 1);
*status = RIG_POWER_ON; *status = RIG_POWER_ON;
priv->powerstat = 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 *status = RIG_POWER_OFF; // Error indicates power is off
rig_debug(RIG_DEBUG_VERBOSE, "%s read_string failed\n", __func__); rig_debug(RIG_DEBUG_VERBOSE, "%s read_string failed\n", __func__);