From 5447b288cb0bc6c49f0c8fe774314785d626cdb6 Mon Sep 17 00:00:00 2001 From: Sergey Kolomenkin Date: Tue, 2 May 2023 19:31:17 +0400 Subject: [PATCH] natsConnection_Buffered: fix returned value in case of error This function returns number of bytes in the buffer. It is incorrect to return value from natsStatus enum. --- src/conn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conn.c b/src/conn.c index 0dddffc4..b769a771 100644 --- a/src/conn.c +++ b/src/conn.c @@ -3811,7 +3811,7 @@ natsConnection_Buffered(natsConnection *nc) int buffered = -1; if (nc == NULL) - return nats_setDefaultError(NATS_INVALID_ARG); + return buffered; natsConn_Lock(nc);