|
|
a5bd9f6 |
From f1673a4b7079d134fa966da37adf409ea42efe8c Mon Sep 17 00:00:00 2001
|
|
|
5e0db24 |
From: Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
|
|
|
5e0db24 |
Date: Tue, 27 Nov 2012 16:58:39 -0200
|
|
|
a5bd9f6 |
Subject: [PATCH 357/364] Add %X option to printf functions.
|
|
|
5e0db24 |
|
|
|
5e0db24 |
---
|
|
|
a5bd9f6 |
grub-core/kern/misc.c | 7 +++++--
|
|
|
5e0db24 |
1 file changed, 5 insertions(+), 2 deletions(-)
|
|
|
5e0db24 |
|
|
|
5e0db24 |
diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c
|
|
|
a5bd9f6 |
index 94b88a3..d5ca312 100644
|
|
|
5e0db24 |
--- a/grub-core/kern/misc.c
|
|
|
5e0db24 |
+++ b/grub-core/kern/misc.c
|
|
|
5e0db24 |
@@ -596,7 +596,7 @@ grub_divmod64 (grub_uint64_t n, grub_uint64_t d, grub_uint64_t *r)
|
|
|
5e0db24 |
static char *
|
|
|
5e0db24 |
grub_lltoa (char *str, int c, unsigned long long n)
|
|
|
5e0db24 |
{
|
|
|
5e0db24 |
- unsigned base = (c == 'x') ? 16 : 10;
|
|
|
5e0db24 |
+ unsigned base = ((c == 'x') || (c == 'X')) ? 16 : 10;
|
|
|
5e0db24 |
char *p;
|
|
|
5e0db24 |
|
|
|
5e0db24 |
if ((long long) n < 0 && c == 'd')
|
|
|
5e0db24 |
@@ -611,7 +611,7 @@ grub_lltoa (char *str, int c, unsigned long long n)
|
|
|
5e0db24 |
do
|
|
|
5e0db24 |
{
|
|
|
5e0db24 |
unsigned d = (unsigned) (n & 0xf);
|
|
|
5e0db24 |
- *p++ = (d > 9) ? d + 'a' - 10 : d + '0';
|
|
|
5e0db24 |
+ *p++ = (d > 9) ? d + ((c == 'x') ? 'a' : 'A') - 10 : d + '0';
|
|
|
5e0db24 |
}
|
|
|
5e0db24 |
while (n >>= 4);
|
|
|
5e0db24 |
else
|
|
|
5e0db24 |
@@ -702,6 +702,7 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, va_list a
|
|
|
5e0db24 |
{
|
|
|
5e0db24 |
case 'p':
|
|
|
5e0db24 |
case 'x':
|
|
|
5e0db24 |
+ case 'X':
|
|
|
5e0db24 |
case 'u':
|
|
|
5e0db24 |
case 'd':
|
|
|
5e0db24 |
case 'c':
|
|
|
a5bd9f6 |
@@ -780,6 +781,7 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, va_list a
|
|
|
5e0db24 |
switch (c)
|
|
|
5e0db24 |
{
|
|
|
5e0db24 |
case 'x':
|
|
|
5e0db24 |
+ case 'X':
|
|
|
5e0db24 |
case 'u':
|
|
|
5e0db24 |
case 'd':
|
|
|
5e0db24 |
if (longlongfmt)
|
|
|
a5bd9f6 |
@@ -921,6 +923,7 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, va_list a
|
|
|
5e0db24 |
longlongfmt |= (sizeof (void *) == sizeof (long long));
|
|
|
5e0db24 |
/* Fall through. */
|
|
|
5e0db24 |
case 'x':
|
|
|
5e0db24 |
+ case 'X':
|
|
|
5e0db24 |
case 'u':
|
|
|
5e0db24 |
unsig = 1;
|
|
|
5e0db24 |
/* Fall through. */
|
|
|
5e0db24 |
--
|
|
|
a5bd9f6 |
1.8.1.4
|
|
|
5e0db24 |
|