Fix redundant cppcheck warnings

https://github.com/Hamlib/Hamlib/issues/1351
pull/1392/head
Mike Black W9MDB 2023-10-01 11:54:44 -05:00
rodzic 53855c868d
commit e1e7112cb5
2 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

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

Wyświetl plik

@ -1307,7 +1307,7 @@ static int read_string_generic(hamlib_port_t *p,
int i = 0;
static int minlen = 1; // dynamic minimum length of rig response data
if (!p->asyncio && !direct)
if (p != NULL && !p->asyncio && !direct)
{
return -RIG_EINTERNAL;
}
@ -1461,7 +1461,7 @@ static int read_string_generic(hamlib_port_t *p,
if (total_count > 1 && rxbuffer[0] == ';')
{
while (rxbuffer[0] == ';' && rxbuffer[0] != 0 && total_count > 1)
while (rxbuffer[0] == ';' && total_count > 1)
{
memmove(rxbuffer, &rxbuffer[1], strlen((char *)rxbuffer) - 1);
--total_count;