summaryrefslogtreecommitdiff
path: root/examples/mrp_client
diff options
context:
space:
mode:
authorJean-Baptiste Maillet <jean-baptiste.maillet@parrot.com>2014-12-18 10:47:59 +0100
committerJean-Baptiste Maillet <jean-baptiste.maillet@parrot.com>2014-12-18 10:47:59 +0100
commit92417a6e9944afb82469bc7b5db878171dbb674f (patch)
treecddf3a948b1804bf88224c9164a856a2a481b3bc /examples/mrp_client
parentb22cd6a98a7485b7e7a966b886277b3b1d5e6884 (diff)
downloadOpen-AVB-92417a6e9944afb82469bc7b5db878171dbb674f.tar.gz
mrpl: mrpdclient_sendto does not return 0/-1, so don't OR its return
Diffstat (limited to 'examples/mrp_client')
-rwxr-xr-xexamples/mrp_client/mrpl.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/examples/mrp_client/mrpl.c b/examples/mrp_client/mrpl.c
index 90fa412b..10bc9435 100755
--- a/examples/mrp_client/mrpl.c
+++ b/examples/mrp_client/mrpl.c
@@ -109,6 +109,10 @@ int main(int argc, char *argv[])
memset(msgbuf, 0, MRPDCLIENT_MAX_MSG_SIZE);
sprintf(msgbuf, "S+D:C=6,P=3,V=0002");
rc = mrpdclient_sendto(mrpd_sock, msgbuf, MRPDCLIENT_MAX_MSG_SIZE);
+ if (rc != MRPDCLIENT_MAX_MSG_SIZE) {
+ printf("mrpdclient_sendto failed\n");
+ return EXIT_FAILURE;
+ }
memset(msgbuf, 0, MRPDCLIENT_MAX_MSG_SIZE);
if (leave)
@@ -118,9 +122,12 @@ int main(int argc, char *argv[])
rc = mrpdclient_sendto(mrpd_sock, msgbuf, MRPDCLIENT_MAX_MSG_SIZE);
free(msgbuf);
+ if (rc != MRPDCLIENT_MAX_MSG_SIZE) {
+ printf("mrpdclient_sendto failed\n");
+ return EXIT_FAILURE;
+ }
- rc |= mrpdclient_close(&mrpd_sock);
-
+ rc = mrpdclient_close(&mrpd_sock);
if (-1 == rc)
return EXIT_FAILURE;
else