Skip to content

Commit

Permalink
Merge pull request OpenAtomFoundation#368 from Eric-hust/master
Browse files Browse the repository at this point in the history
[HUST CSE]Modify the null pointer fifo to access first and then judge
  • Loading branch information
Supowang1989 authored Apr 23, 2023
2 parents 4e17ab6 + 1961644 commit 250ca3e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/connectivity/mqttclient/common/log/fifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ unsigned int salof_fifo_read(salof_fifo_t fifo, void *buff, unsigned int len, un
{
int l;

salof_sem_pend(fifo->sem, timeout);

if((!fifo) || (!buff) || (!len))
return 0;

salof_sem_pend(fifo->sem, timeout);

len = FIFO_MIN(len, fifo->in - fifo->out);

Expand Down

0 comments on commit 250ca3e

Please sign in to comment.