Fix cppcheck warnings

pull/1354/head
Mike Black W9MDB 2023-08-02 17:24:11 -05:00
rodzic 6a4e31f890
commit d48d12c972
4 zmienionych plików z 7 dodań i 11 usunięć

Wyświetl plik

@ -812,7 +812,7 @@ static int netrigctl_open(RIG *rig)
{
int agc_code;
char agc_string[32];
int n = sscanf(p, "%d=%s\n", &agc_code, agc_string);
int n = sscanf(p, "%d=%31s\n", &agc_code, agc_string);
if (n == 2)
{

Wyświetl plik

@ -753,7 +753,7 @@ static int quisk_open(RIG *rig)
{
int agc_code;
char agc_string[32];
int n = sscanf(p, "%d=%s\n", &agc_code, agc_string);
int n = sscanf(p, "%d=%31s\n", &agc_code, agc_string);
if (n == 2)
{

Wyświetl plik

@ -173,11 +173,7 @@ static int dummy_rot_cleanup(ROT *rot)
free(priv->ext_levels);
free(priv->ext_parms);
free(priv->magic_conf);
if (rot->state.priv)
{
free(rot->state.priv);
}
free(rot->state.priv);
rot->state.priv = NULL;

Wyświetl plik

@ -622,7 +622,7 @@ static int tci1x_open(RIG *rig)
// we fall through and assume old version
}
sscanf(&value[2], "device:%s", value);
sscanf(&value[2], "device:%8191s", value);
rig_debug(RIG_DEBUG_VERBOSE, "%s: TCI Device is %s\n", __func__, arg);
@ -635,8 +635,8 @@ static int tci1x_open(RIG *rig)
rigerror(retval));
}
sscanf(&value[2], "receive_only:%s", value);
rig_debug(RIG_DEBUG_VERBOSE, "%s: readonly is %s\n", __func__, arg);
sscanf(&value[2], "receive_only:%8191s", value);
rig_debug(RIG_DEBUG_VERBOSE, "%s: readonly is %8191s\n", __func__, arg);
// TRX count
retval = tci1x_transaction(rig, "trx_count;", NULL, value, sizeof(value));
@ -820,7 +820,7 @@ static int tci1x_cleanup(RIG *rig)
ENTERFUNC;
if (!rig)
if (rig == NULL)
{
RETURNFUNC(-RIG_EINVAL);
}