net/local: Fix receive data size calculation for local_recvmsg

In psock_dgram_recvfrom function, fix code logic.
This commit is contained in:
SPRESENSE 2021-08-06 14:17:22 +09:00 committed by Xiang Xiao
parent 1060953567
commit d17d877764
1 changed files with 2 additions and 1 deletions

View File

@ -289,7 +289,7 @@ psock_dgram_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
{
/* Read 32 bytes into the bit bucket */
readlen = MIN(remaining, 32);
tmplen = MIN(remaining, 32);
ret = psock_fifo_read(psock, bitbucket, &tmplen, false);
if (ret < 0)
{
@ -302,6 +302,7 @@ psock_dgram_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
DEBUGASSERT(tmplen <= remaining);
remaining -= tmplen;
readlen += tmplen;
}
while (remaining > 0);
}