[LTP] [COMMITTED] [PATCH] syscalls/dup203.c: Fix a compiler error

ice_yangxiao@163.com ice_yangxiao@163.com
Mon Sep 20 07:34:53 CEST 2021


From: Xiao Yang <yangx.jy@fujitsu.com>

Building dup203 threw the following error:
-----------------------------------------
dup203.c:40:2: error: format string is not a string literal
-----------------------------------------

Fixes: 711f40c09bdb ("syscalls/dup2/dup203: Convert to new API")
Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
---
 testcases/kernel/syscalls/dup2/dup203.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/dup2/dup203.c b/testcases/kernel/syscalls/dup2/dup203.c
index e2282ed2b..c76f125a1 100644
--- a/testcases/kernel/syscalls/dup2/dup203.c
+++ b/testcases/kernel/syscalls/dup2/dup203.c
@@ -37,7 +37,7 @@ static void run(unsigned int i)
 
 	struct tcase *tc = tcases + i;
 
-	tst_res(TINFO, tc->desc);
+	tst_res(TINFO, "%s", tc->desc);
 
 	fd0 = SAFE_CREAT(filename0, 0666);
 	SAFE_WRITE(1, fd0, filename0, strlen(filename0));
-- 
2.26.2




More information about the ltp mailing list