[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20241112094538.287524-1-luoyifan@cmss.chinamobile.com>
Date: Tue, 12 Nov 2024 17:45:38 +0800
From: Luo Yifan <luoyifan@...s.chinamobile.com>
To: acme@...nel.org,
jolsa@...nel.org,
namhyung@...nel.org,
adrian.hunter@...el.com
Cc: linux-kernel@...r.kernel.org,
Luo Yifan <luoyifan@...s.chinamobile.com>
Subject: [PATCH] tools/lib: Fix the wrong format specifier in str_error_r
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@...s.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
Powered by blists - more mailing lists