kopia lustrzana https://github.com/Hamlib/Hamlib
Fix cppcheck warnings in thd72.c
rodzic
3875e4db04
commit
d3c9c8113c
|
@ -378,7 +378,7 @@ static int thd72_get_freq_info(RIG *rig, vfo_t vfo, char *buf)
|
|||
|
||||
sprintf(cmd, "FO %c", c);
|
||||
retval = kenwood_transaction(rig, cmd, buf, 53);
|
||||
return RIG_OK;
|
||||
return retval;
|
||||
}
|
||||
|
||||
/* item is an offset into reply buf that is a single char */
|
||||
|
@ -1047,7 +1047,7 @@ static int thd72_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
|
||||
retval = sscanf(buf, "SQ %d,%d", &v, &l);
|
||||
|
||||
if (retval != 2 || l < 0 || l > 6)
|
||||
if (retval != 2 || l < 0 || l >= 6)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Unexpected reply '%s'\n", __func__, buf);
|
||||
return -RIG_ERJCTED;
|
||||
|
@ -1353,13 +1353,14 @@ static int thd72_parse_channel(int kind, const char *buf, channel_t *chan)
|
|||
|
||||
static int thd72_get_channel(RIG *rig, channel_t *chan)
|
||||
{
|
||||
int retval, len;
|
||||
char cmd[8], buf[72];
|
||||
int retval;
|
||||
char buf[72];
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__);
|
||||
|
||||
if (chan->vfo == RIG_VFO_MEM) /* memory channel */
|
||||
{
|
||||
char cmd[16];
|
||||
sprintf(cmd, "ME %03d", chan->channel_num);
|
||||
retval = kenwood_transaction(rig, cmd, buf, sizeof(buf));
|
||||
|
||||
|
@ -1383,7 +1384,7 @@ static int thd72_get_channel(RIG *rig, channel_t *chan)
|
|||
return retval;
|
||||
}
|
||||
|
||||
len = strlen(buf);
|
||||
int len = strlen(buf);
|
||||
memcpy(chan->channel_desc, buf + 7, len - 7);
|
||||
}
|
||||
else /* current channel */
|
||||
|
@ -1467,6 +1468,7 @@ static int thd72_get_block(RIG *rig, int block_num, char *block)
|
|||
return RIG_OK;
|
||||
}
|
||||
|
||||
#ifdef XXREMOVEDXX
|
||||
int thd72_get_chan_all_cb(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
|
||||
{
|
||||
int i, j, ret;
|
||||
|
@ -1599,6 +1601,7 @@ int thd72_get_chan_all_cb(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
|
|||
|
||||
return RIG_OK;
|
||||
}
|
||||
#endif
|
||||
#endif /* none working stuff */
|
||||
/*
|
||||
* th-d72a rig capabilities.
|
||||
|
@ -1608,7 +1611,7 @@ const struct rig_caps thd72a_caps =
|
|||
.rig_model = RIG_MODEL_THD72A,
|
||||
.model_name = "TH-D72A",
|
||||
.mfg_name = "Kenwood",
|
||||
.version = TH_VER ".3",
|
||||
.version = TH_VER ".4",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_BETA,
|
||||
.rig_type = RIG_TYPE_HANDHELD | RIG_FLAG_APRS | RIG_FLAG_TNC | RIG_FLAG_DXCLUSTER,
|
||||
|
|
Ładowanie…
Reference in New Issue