From c9d030158940138bbf3a8ffc0f3f0d0e2eba1687 Mon Sep 17 00:00:00 2001 From: jsg Date: Wed, 22 Dec 2021 23:05:52 +0000 Subject: [PATCH] Avoid GNU printf extension to use 'L' length modifier with a int conversion specifier to mean 'll'. Found by an ok deraadt@ --- gnu/usr.bin/binutils-2.17/binutils/strings.c | 4 ++-- gnu/usr.bin/binutils/binutils/strings.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gnu/usr.bin/binutils-2.17/binutils/strings.c b/gnu/usr.bin/binutils-2.17/binutils/strings.c index ede1bd59dd4..dbff317ff46 100644 --- a/gnu/usr.bin/binutils-2.17/binutils/strings.c +++ b/gnu/usr.bin/binutils-2.17/binutils/strings.c @@ -614,7 +614,7 @@ print_strings (const char *filename, FILE *stream, file_off address, case 10: #if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2) if (sizeof (start) > sizeof (long)) - printf ("%7Ld ", (unsigned long long) start); + printf ("%7lld ", (unsigned long long) start); else #else # if !BFD_HOST_64BIT_LONG @@ -629,7 +629,7 @@ print_strings (const char *filename, FILE *stream, file_off address, case 16: #if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2) if (sizeof (start) > sizeof (long)) - printf ("%7Lx ", (unsigned long long) start); + printf ("%7llx ", (unsigned long long) start); else #else # if !BFD_HOST_64BIT_LONG diff --git a/gnu/usr.bin/binutils/binutils/strings.c b/gnu/usr.bin/binutils/binutils/strings.c index 18b41dc5f58..fccbe04d626 100644 --- a/gnu/usr.bin/binutils/binutils/strings.c +++ b/gnu/usr.bin/binutils/binutils/strings.c @@ -540,7 +540,7 @@ print_strings (const char *filename, FILE *stream, file_off address, case 10: #if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2) if (sizeof (start) > sizeof (long)) - printf ("%7Ld ", (unsigned long long) start); + printf ("%7lld ", (unsigned long long) start); else #else # if !BFD_HOST_64BIT_LONG @@ -555,7 +555,7 @@ print_strings (const char *filename, FILE *stream, file_off address, case 16: #if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2) if (sizeof (start) > sizeof (long)) - printf ("%7Lx ", (unsigned long long) start); + printf ("%7llx ", (unsigned long long) start); else #else # if !BFD_HOST_64BIT_LONG -- 2.20.1