[Skiboot] [PATCH 13/13] libc/test/run-snprintf: int -> unsigned int

Stewart Smith stewart at linux.vnet.ibm.com
Wed Aug 23 17:21:23 AEST 2017


UBSan:
libc/test/run-snprintf.c:123:9: runtime error: left shift of 268435456 by 4 places cannot be represented in type 'int'

Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
---
 libc/test/run-snprintf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libc/test/run-snprintf.c b/libc/test/run-snprintf.c
index 80993e89748e..5e6703036c89 100644
--- a/libc/test/run-snprintf.c
+++ b/libc/test/run-snprintf.c
@@ -107,7 +107,8 @@ static void test_printf_x(const char* f)
 {
 	char *buf, *buf2;
 	int blen;
-	int i, r, n=0x1;
+	int i, r;
+	unsigned int n=0x1;
 
 	for (i=0; i<8; i++)
 	{
-- 
2.13.5



More information about the Skiboot mailing list