]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Lib: Fix print of 64-bit router id
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Wed, 17 Jul 2019 23:57:26 +0000 (01:57 +0200)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Wed, 17 Jul 2019 23:57:26 +0000 (01:57 +0200)
Mismatched types to printf(). The old code coincidentally worked on amd64
due to its calling conventions.

Thanks to Maximilian Eschenbacher for the bugreport.

lib/printf.c

index c2065d9a988057a9ddaae007484f1d9db74035b7..8f2cccb30ef47acb40d5e820cbe47b546e38961b 100644 (file)
@@ -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
                        {