Fix cppcheck warnings in trxmanager.c

pull/168/head
Michael Black 2020-01-08 22:50:03 -06:00
rodzic 5572823882
commit 97ea79082a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6599353EC683404D
1 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -298,6 +298,7 @@ static int trxmanager_open(RIG *rig)
{
int retval;
char *cmd;
char *saveptr;
char response[MAXCMDLEN] = "";
struct rig_state *rs = &rig->state;
struct trxmanager_priv_data *priv = (struct trxmanager_priv_data *)
@ -320,7 +321,7 @@ static int trxmanager_open(RIG *rig)
}
// Should have rig info now
strtok(response, ";\r\n");
strtok_r(response, ";\r\n", &saveptr);
strncpy(priv->info, &response[2], sizeof(priv->info));
rig_debug(RIG_DEBUG_VERBOSE, "%s connected to %s\n", __func__, priv->info);
@ -870,8 +871,9 @@ static int trxmanager_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode,
if (n != 1)
{
char *saveptr;
rig_debug(RIG_DEBUG_ERR, "%s bandwidth scan failed '%s'\n", __func__,
strtok(response, "\r\n"));
strtok_r(response, "\r\n", &saveptr));
return -RIG_EPROTO;
}