mirror of
https://github.com/Hamlib/Hamlib
synced 2026-08-13 17:32:05 -04:00
Fix segfault with testrig and fifo bad values
This commit is contained in:
parent
2c83486775
commit
64cb40f066
1 changed files with 2 additions and 0 deletions
|
|
@ -37,6 +37,8 @@ int push(FIFO_RIG *fifo, const char *msg)
|
|||
|
||||
int peek(FIFO_RIG *fifo)
|
||||
{
|
||||
if (fifo->tail < 0 || fifo->head < 0) return -1;
|
||||
if (fifo->tail > 1023 || fifo->head > 1023) return -1;
|
||||
if (fifo->tail == fifo->head) { return -1; }
|
||||
char c = fifo->data[fifo->head];
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: peek %c (%d,%d)\n", __func__, c, fifo->head,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue