From d15d72235206a3c2925a4f96471b443fc51d90bc Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Thu, 4 Feb 2021 13:38:09 +0100 Subject: [PATCH] log_error(): Silence a warning when compiling with NDEBUG --- errlog.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/errlog.c b/errlog.c index 969c0bd7..e9aba277 100644 --- a/errlog.c +++ b/errlog.c @@ -815,7 +815,10 @@ void log_error(int loglevel, const char *fmt, ...) int ret = snprintf(outbuf + length, log_buffer_size - length - 2, "\\x%.2x", (unsigned char)*sval); assert(ret == 4); - length += 4; + if (ret == 4) + { + length += 4; + } } sval++; } -- 2.39.2