From 6a627acea70e14113f1d62b2da23b054ebf5e5e8 Mon Sep 17 00:00:00 2001 From: Dahko Date: Mon, 17 Mar 2014 16:38:19 +0300 Subject: [PATCH] Fixed wrong assert in zmq_recv zmq_recv returns bytes count, not error code, so 'assert (rc==0)' behaved completely wrong --- doc/zmq_msg_init.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/zmq_msg_init.txt b/doc/zmq_msg_init.txt index 199f084e..c94d7083 100644 --- a/doc/zmq_msg_init.txt +++ b/doc/zmq_msg_init.txt @@ -44,8 +44,8 @@ EXAMPLE zmq_msg_t msg; rc = zmq_msg_init (&msg); assert (rc == 0); -rc = zmq_recv (socket, &msg, 0); -assert (rc == 0); +int nbytes = zmq_recv (socket, &msg, 0); +assert (nbytes != -1); ----