log_error(): Silence a warning when compiling with NDEBUG
authorFabian Keil <fk@fabiankeil.de>
Thu, 4 Feb 2021 12:38:09 +0000 (13:38 +0100)
committerFabian Keil <fk@fabiankeil.de>
Sun, 21 Feb 2021 15:09:20 +0000 (16:09 +0100)
errlog.c

index 969c0bd..e9aba27 100644 (file)
--- 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++;
             }