public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/lib: Fix the wrong format specifier in str_error_r
@ 2024-11-12  9:45 Luo Yifan
  0 siblings, 0 replies; only message in thread
From: Luo Yifan @ 2024-11-12  9:45 UTC (permalink / raw)
  To: acme, jolsa, namhyung, adrian.hunter; +Cc: linux-kernel, Luo Yifan

Make a minor change to eliminate a static checker warning. The
variable buflen is unsigned, so the correct format specifier should
be %zu instead of %zd.

Signed-off-by: Luo Yifan <luoyifan@cmss.chinamobile.com>
---
 tools/lib/str_error_r.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/lib/str_error_r.c b/tools/lib/str_error_r.c
index 6aad8308a..276596a75 100644
--- a/tools/lib/str_error_r.c
+++ b/tools/lib/str_error_r.c
@@ -22,6 +22,6 @@ char *str_error_r(int errnum, char *buf, size_t buflen)
 {
 	int err = strerror_r(errnum, buf, buflen);
 	if (err)
-		snprintf(buf, buflen, "INTERNAL ERROR: strerror_r(%d, [buf], %zd)=%d", errnum, buflen, err);
+		snprintf(buf, buflen, "INTERNAL ERROR: strerror_r(%d, [buf], %zu)=%d", errnum, buflen, err);
 	return buf;
 }
-- 
2.27.0




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-11-12  9:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-12  9:45 [PATCH] tools/lib: Fix the wrong format specifier in str_error_r Luo Yifan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox