2013-06-07 18:03:56 +00:00
|
|
|
From 2a71d2434b01daaafa64cd340ea441def459d880 Mon Sep 17 00:00:00 2001
|
2012-11-27 20:08:53 +00:00
|
|
|
From: Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
|
|
|
|
Date: Tue, 27 Nov 2012 16:58:39 -0200
|
2013-06-12 19:24:37 +00:00
|
|
|
Subject: [PATCH 455/482] Add %X option to printf functions.
|
2012-11-27 20:08:53 +00:00
|
|
|
|
|
|
|
---
|
2013-05-02 20:54:52 +00:00
|
|
|
grub-core/kern/misc.c | 7 +++++--
|
2012-11-27 20:08:53 +00:00
|
|
|
1 file changed, 5 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c
|
2013-05-02 20:54:52 +00:00
|
|
|
index 94b88a3..d5ca312 100644
|
2012-11-27 20:08:53 +00:00
|
|
|
--- a/grub-core/kern/misc.c
|
|
|
|
+++ b/grub-core/kern/misc.c
|
|
|
|
@@ -596,7 +596,7 @@ grub_divmod64 (grub_uint64_t n, grub_uint64_t d, grub_uint64_t *r)
|
|
|
|
static 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')
|
|
|
|
@@ -611,7 +611,7 @@ grub_lltoa (char *str, int c, unsigned long long n)
|
|
|
|
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
|
|
|
|
@@ -702,6 +702,7 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, va_list a
|
|
|
|
{
|
|
|
|
case 'p':
|
|
|
|
case 'x':
|
|
|
|
+ case 'X':
|
|
|
|
case 'u':
|
|
|
|
case 'd':
|
|
|
|
case 'c':
|
2013-05-02 20:54:52 +00:00
|
|
|
@@ -780,6 +781,7 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, va_list a
|
2012-11-27 20:08:53 +00:00
|
|
|
switch (c)
|
|
|
|
{
|
|
|
|
case 'x':
|
|
|
|
+ case 'X':
|
|
|
|
case 'u':
|
|
|
|
case 'd':
|
|
|
|
if (longlongfmt)
|
2013-05-02 20:54:52 +00:00
|
|
|
@@ -921,6 +923,7 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, va_list a
|
2012-11-27 20:08:53 +00:00
|
|
|
longlongfmt |= (sizeof (void *) == sizeof (long long));
|
|
|
|
/* Fall through. */
|
|
|
|
case 'x':
|
|
|
|
+ case 'X':
|
|
|
|
case 'u':
|
|
|
|
unsig = 1;
|
|
|
|
/* Fall through. */
|
|
|
|
--
|
2013-06-07 18:03:56 +00:00
|
|
|
1.8.2.1
|
2012-11-27 20:08:53 +00:00
|
|
|
|