|
|
9723a8 |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
9723a8 |
From: Thomas Frauendorfer | Miray Software <tf@miray.de>
|
|
|
9723a8 |
Date: Mon, 15 Feb 2021 13:40:16 +0100
|
|
|
9723a8 |
Subject: [PATCH] kern/misc: Split parse_printf_args() into format parsing and
|
|
|
9723a8 |
va_list handling
|
|
|
9723a8 |
|
|
|
9723a8 |
This patch is preparing for a follow up patch which will use
|
|
|
9723a8 |
the format parsing part to compare the arguments in a printf()
|
|
|
9723a8 |
format from an external source against a printf() format with
|
|
|
9723a8 |
expected arguments.
|
|
|
9723a8 |
|
|
|
9723a8 |
Signed-off-by: Thomas Frauendorfer | Miray Software <tf@miray.de>
|
|
|
9723a8 |
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
|
|
9723a8 |
---
|
|
|
9723a8 |
grub-core/kern/misc.c | 11 +++++++++--
|
|
|
9723a8 |
1 file changed, 9 insertions(+), 2 deletions(-)
|
|
|
9723a8 |
|
|
|
9723a8 |
diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c
|
|
|
9723a8 |
index 62b4068e810..ca851c29d51 100644
|
|
|
9723a8 |
--- a/grub-core/kern/misc.c
|
|
|
9723a8 |
+++ b/grub-core/kern/misc.c
|
|
|
9723a8 |
@@ -678,8 +678,7 @@ grub_lltoa (char *str, int c, unsigned long long n)
|
|
|
9723a8 |
}
|
|
|
9723a8 |
|
|
|
9723a8 |
static void
|
|
|
9723a8 |
-parse_printf_args (const char *fmt0, struct printf_args *args,
|
|
|
9723a8 |
- va_list args_in)
|
|
|
9723a8 |
+parse_printf_arg_fmt (const char *fmt0, struct printf_args *args)
|
|
|
9723a8 |
{
|
|
|
9723a8 |
const char *fmt;
|
|
|
9723a8 |
char c;
|
|
|
9723a8 |
@@ -837,6 +836,14 @@ parse_printf_args (const char *fmt0, struct printf_args *args,
|
|
|
9723a8 |
break;
|
|
|
9723a8 |
}
|
|
|
9723a8 |
}
|
|
|
9723a8 |
+}
|
|
|
9723a8 |
+
|
|
|
9723a8 |
+static void
|
|
|
9723a8 |
+parse_printf_args (const char *fmt0, struct printf_args *args, va_list args_in)
|
|
|
9723a8 |
+{
|
|
|
9723a8 |
+ grub_size_t n;
|
|
|
9723a8 |
+
|
|
|
9723a8 |
+ parse_printf_arg_fmt (fmt0, args);
|
|
|
9723a8 |
|
|
|
9723a8 |
for (n = 0; n < args->count; n++)
|
|
|
9723a8 |
switch (args->ptr[n].type)
|