Added error message in case of invalid parameter

This commit is contained in:
Stefan Wahren 2012-05-20 03:05:26 +02:00
parent 0ed30c1ad9
commit 45ebed05b7
2 changed files with 6 additions and 0 deletions

View File

@ -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));

View File

@ -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));