Fix possible null pointer warning from cppcheck

https://github.com/Hamlib/Hamlib/issues/1351
pull/1404/head
Mike Black W9MDB 2023-10-02 12:32:20 -05:00
rodzic 1a4a189dbc
commit 717a451d9c
3 zmienionych plików z 243 dodań i 213 usunięć

Wyświetl plik

@ -469,7 +469,7 @@ int HAMLIB_API amp_close(AMP *amp)
if (amp == NULL || amp->caps == NULL)
{
amp_debug(RIG_DEBUG_ERR, "%s: NULL ptr? amp=%p, amp->caps=%p\n", __func__, amp,
amp->caps);
amp->caps==NULL?NULL:amp->caps);
return -RIG_EINVAL;
}

Wyświetl plik

@ -641,7 +641,8 @@ int main(int argc, char *argv[])
if (rig == NULL)
{
fprintf(stderr, "rig==NULL?\n");
return 1;
}
strncpy(rig->state.rigport.pathname, "/dev/ttyUSB0", HAMLIB_FILPATHLEN - 1);

451
src/rig.c

Plik diff jest za duży Load Diff