summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/example_utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/example_utils.c b/examples/example_utils.c
index de6694d..26b98db 100644
--- a/examples/example_utils.c
+++ b/examples/example_utils.c
@@ -26,7 +26,8 @@ void die_on_amqp_error(amqp_rpc_reply_t x, char const *context) {
break;
case AMQP_RESPONSE_LIBRARY_EXCEPTION:
- fprintf(stderr, "%s: %s\n", context, strerror(x.library_errno));
+ fprintf(stderr, "%s: %s\n", context,
+ x.library_errno ? strerror(x.library_errno) : "(end-of-stream)");
break;
case AMQP_RESPONSE_SERVER_EXCEPTION: