From 92b482af50f367c1416c4a70ceabab36c19788d1 Mon Sep 17 00:00:00 2001 From: Antonio Borneo Date: Sun, 25 Jan 2026 11:02:02 +0100 Subject: [PATCH] log: change line counter to unsigned The incremental counter of logged lines is a signed int. Change it to unsigned, since negative values has no sense in this context. Change-Id: Ia75f9ca038bba385c5f88fb9fa368faaf055f9a3 Signed-off-by: Antonio Borneo Reviewed-on: https://review.openocd.org/c/openocd/+/9401 Reviewed-by: R. Diez Tested-by: jenkins --- src/helper/log.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helper/log.c b/src/helper/log.c index 1d459825f..caed8a9da 100644 --- a/src/helper/log.c +++ b/src/helper/log.c @@ -47,7 +47,7 @@ static const char * const log_strings[7] = { "Debug: ", /* corresponds to LOG_LVL_DEBUG_USB */ }; -static int count; +static unsigned int count; /* forward the log to the listeners */ static void log_forward(const char *file, unsigned int line, const char *function, const char *string) @@ -110,7 +110,7 @@ static void log_puts(enum log_levels level, #error "Configuration error: Neither mallinfo() nor mallinfo2() are available." #endif #endif - fprintf(log_output, "%s%d %" PRId64 " %s:%d %s()" + fprintf(log_output, "%s%u %" PRId64 " %s:%d %s()" #ifdef _DEBUG_FREE_SPACE_ #ifdef HAVE_MALLINFO2 " %zu"