Fix AGC level patch to apply only to Icom rigs and check priv non null

https://github.com/Hamlib/Hamlib/issues/1096
pull/1102/head
Mike Black W9MDB 2022-07-30 08:32:03 -05:00
rodzic 2b7c2ab5ce
commit 36838e2f73
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -296,7 +296,7 @@ int dumpcaps(RIG *rig, FILE *fout)
const struct icom_priv_caps *priv_caps =
(const struct icom_priv_caps *) rig->caps->priv;
if (priv_caps->agc_levels_present)
if (priv_caps && RIG_BACKEND_NUM(rig->caps->rig_model) == RIG_ICOM && priv_caps->agc_levels_present)
{
for (i = 0; i <= RIG_AGC_LAST && priv_caps->agc_levels[i].level != RIG_AGC_LAST
&& priv_caps->agc_levels[i].icom_level >= 0; i++)