Fix a segfault when abort_p is NULL.
This commit is contained in:
parent
921d28d976
commit
902bbfb04c
1 changed files with 1 additions and 1 deletions
|
@ -226,7 +226,7 @@ static const struct timeval tvTimeout = {
|
||||||
int
|
int
|
||||||
uart_receive (serial_port sp, byte_t * pbtRx, const size_t szRx, void * abort_p)
|
uart_receive (serial_port sp, byte_t * pbtRx, const size_t szRx, void * abort_p)
|
||||||
{
|
{
|
||||||
int iAbortFd = *((int*)abort_p);
|
int iAbortFd = abort_p ? *((int*)abort_p) : 0;
|
||||||
struct timeval tv = tvTimeout;
|
struct timeval tv = tvTimeout;
|
||||||
struct timeval *ptv = &tv;
|
struct timeval *ptv = &tv;
|
||||||
int received_bytes_count = 0;
|
int received_bytes_count = 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue