Added error message in case of invalid parameter
This commit is contained in:
parent
0ed30c1ad9
commit
45ebed05b7
@ -226,7 +226,10 @@ mbus_serial_recv_frame(mbus_serial_handle *handle, mbus_frame *frame)
|
|||||||
int len, remaining, nread;
|
int len, remaining, nread;
|
||||||
|
|
||||||
if (handle == NULL || frame == NULL)
|
if (handle == NULL || frame == NULL)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s: Invalid parameter.\n", __PRETTY_FUNCTION__);
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
memset((void *)buff, 0, sizeof(buff));
|
memset((void *)buff, 0, sizeof(buff));
|
||||||
|
|
||||||
|
@ -168,7 +168,10 @@ mbus_tcp_recv_frame(mbus_tcp_handle *handle, mbus_frame *frame)
|
|||||||
int len, remaining, nread;
|
int len, remaining, nread;
|
||||||
|
|
||||||
if (handle == NULL || frame == NULL)
|
if (handle == NULL || frame == NULL)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s: Invalid parameter.\n", __PRETTY_FUNCTION__);
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
memset((void *)buff, 0, sizeof(buff));
|
memset((void *)buff, 0, sizeof(buff));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user