On Wed, Jul 17, 2019 at 10:33:32PM +0200, Maximilian Eschenbacher wrote:
> Hey everyone,
> 
> the following patch creates a testcase on top of the master branch for
> bsprintf with %lR which fails on both my raspberrys (Raspbian Buster,
> armv6l and armv7l, gcc version 8.3.0). I noticed it by looking at

Hi

Thanks for the bugreport, here is a patch that should fix the issue.

-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santi...@crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
diff --git a/lib/printf.c b/lib/printf.c
index c2065d9a..8f2cccb3 100644
--- a/lib/printf.c
+++ b/lib/printf.c
@@ -356,14 +356,14 @@ int bvsnprintf(char *buf, int size, const char *fmt, va_list args)
 			if (qualifier == 'l') {
 				X = va_arg(args, u64);
 				bsprintf(ipbuf, "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
-					((X >> 56) & 0xff),
-					((X >> 48) & 0xff),
-					((X >> 40) & 0xff),
-					((X >> 32) & 0xff),
-					((X >> 24) & 0xff),
-					((X >> 16) & 0xff),
-					((X >> 8) & 0xff),
-					(X & 0xff));
+					 (uint) ((X >> 56) & 0xff),
+					 (uint) ((X >> 48) & 0xff),
+					 (uint) ((X >> 40) & 0xff),
+					 (uint) ((X >> 32) & 0xff),
+					 (uint) ((X >> 24) & 0xff),
+					 (uint) ((X >> 16) & 0xff),
+					 (uint) ((X >> 8) & 0xff),
+					 (uint) (X & 0xff));
 			}
 			else
 			{

Reply via email to