From d05aa38950e106202b8bd374d73329d2c3e3a4ac Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 24 Nov 2022 15:32:20 +0100 Subject: [PATCH] CLEANUP: peers: fix format string for status messages (int signedness) In issue #1939, Ilya mentions that cppchecks warned about use of "%d" to report the status state that's locally stored as an unsigned int. While technically valid, this will never cause any trouble since in the end what we store there are the applet's states (just a few enum values). Better use %u anyway to silence this warning. --- src/peers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/peers.c b/src/peers.c index 95b4b9f16..fcfa05d71 100644 --- a/src/peers.c +++ b/src/peers.c @@ -616,7 +616,7 @@ static int peer_prepare_status_errormsg(char *msg, size_t size, struct peer_prep unsigned int st1; st1 = p->error_status.st1; - ret = snprintf(msg, size, "%d\n", st1); + ret = snprintf(msg, size, "%u\n", st1); if (ret >= size) return 0;