8000 esp32/ltepp: bug fix for lteppp suspend · pycom/pycom-micropython-sigfox@87f2d8b · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 87f2d8b

Browse files
author
iwahdan88
committed
esp32/ltepp: bug fix for lteppp suspend
1 parent 0b6307f commit 87f2d8b

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

esp32/lte/lteppp.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -494,13 +494,17 @@ static uint32_t lteppp_output_callback(ppp_pcb *pcb, u8_t *data, u32_t len, void
494494
}
495495
else
496496
{
497-
memcpy(&(lteppp_queue_buffer[top]), (const char*)data, len);
498-
top += len;
499-
if(top > LTE_UART_BUFFER_SIZE)
497+
uint32_t temp = top + len;
498+
if(temp > LTE_UART_BUFFER_SIZE)
500499
{
501-
top = LTE_UART_BUFFER_SIZE -1;
500+
return 0;
501+
}
502+
else
503+
{
504+
memcpy(&(lteppp_queue_buffer[top]), (const char*)data, len);
505+
top += len;
506+
return len;
502507
}
503-
return len;
504508
}
505509
return tx_bytes;
506510
}

0 commit comments

Comments
 (0)
0