This is needed for UEFI Boot* variables, which the standard says are
named using upper-case hexadecimal.
Signed-off-by: Colin Watson <cjwatson@ubuntu.com>
Bug-Debian: https://bugs.debian.org/891434
Forwarded: https://lists.gnu.org/archive/html/grub-devel/2019-03/msg00121.html
Last-Update: 2019-03-23
Patch-Name: vsnprintf-upper-case-hex.patch
static inline char *
grub_lltoa (char *str, int c, unsigned long long n)
{
- unsigned base = (c == 'x') ? 16 : 10;
+ unsigned base = (c == 'x' || c == 'X') ? 16 : 10;
char *p;
if ((long long) n < 0 && c == 'd')
do
{
unsigned d = (unsigned) (n & 0xf);
- *p++ = (d > 9) ? d + 'a' - 10 : d + '0';
+ *p++ = (d > 9) ? d + ((c == 'x') ? 'a' : 'A') - 10 : d + '0';
}
while (n >>= 4);
else
{
case 'p':
case 'x':
+ case 'X':
case 'u':
case 'd':
case 'c':
switch (c)
{
case 'x':
+ case 'X':
case 'u':
args->ptr[curn].type = UNSIGNED_INT + longfmt;
break;
c = 'x';
/* Fall through. */
case 'x':
+ case 'X':
case 'u':
case 'd':
{