summaryrefslogtreecommitdiff
path: root/demo/async
diff options
context:
space:
mode:
authortromgy <tromgy@yahoo.com>2020-02-13 19:19:03 -0500
committerGarrett D'Amore <garrett@damore.org>2020-02-13 20:17:51 -0800
commitcdda78dbb793e10a5fcbd4748b9d82207ff0f19a (patch)
treed70ca4c02f8537ad692710ca93528fde8d6923d6 /demo/async
parent9d121574e7bf23e5735c157e35726c1dd9e94c17 (diff)
downloadnng-cdda78dbb793e10a5fcbd4748b9d82207ff0f19a.tar.gz
nng-cdda78dbb793e10a5fcbd4748b9d82207ff0f19a.tar.bz2
nng-cdda78dbb793e10a5fcbd4748b9d82207ff0f19a.zip
Fix error checks
Most error codes in `nng_errno_enum` are positve values, so the existing error check would not catch something like `NNG_ECONNREFUSED`.
Diffstat (limited to 'demo/async')
-rw-r--r--demo/async/client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/demo/async/client.c b/demo/async/client.c
index a7fbb6d9..1247365e 100644
--- a/demo/async/client.c
+++ b/demo/async/client.c
@@ -53,7 +53,7 @@ client(const char *url, const char *msecstr)
fatal("nng_req0_open", rv);
}
- if ((rv = nng_dial(sock, url, NULL, 0)) < 0) {
+ if ((rv = nng_dial(sock, url, NULL, 0)) != 0) {
fatal("nng_dial", rv);
}