https://git.reactos.org/?p=reactos.git;a=commitdiff;h=60fbf459c33f6b5829ed2…
commit 60fbf459c33f6b5829ed2cafdf00a8aa53fa1f8c
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Wed Jan 1 21:08:37 2020 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed Jan 1 21:15:05 2020 +0100
[FREELDR] Simplify the PrintText() and FrLdrBugCheckWithMessage() routines by using a
new PrintTextV() helper.
---
boot/freeldr/freeldr/arch/i386/i386bug.c | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/boot/freeldr/freeldr/arch/i386/i386bug.c
b/boot/freeldr/freeldr/arch/i386/i386bug.c
index 233b33332ef..f94639650f4 100644
--- a/boot/freeldr/freeldr/arch/i386/i386bug.c
+++ b/boot/freeldr/freeldr/arch/i386/i386bug.c
@@ -73,17 +73,24 @@ i386PrintText(CHAR *pszText)
}
static void
-PrintText(const CHAR *format, ...)
+PrintTextV(const CHAR *Format, va_list args)
+{
+ CHAR Buffer[512];
+
+ _vsnprintf(Buffer, sizeof(Buffer), Format, args);
+ Buffer[sizeof(Buffer) - 1] = ANSI_NULL;
+
+ i386PrintText(Buffer);
+}
+
+static void
+PrintText(const CHAR *Format, ...)
{
va_list argptr;
- CHAR buffer[256];
- va_start(argptr, format);
- _vsnprintf(buffer, sizeof(buffer), format, argptr);
- buffer[sizeof(buffer) - 1] = ANSI_NULL;
+ va_start(argptr, Format);
+ PrintTextV(Format, argptr);
va_end(argptr);
-
- i386PrintText(buffer);
}
static void
@@ -187,7 +194,6 @@ FrLdrBugCheckWithMessage(
PSTR Format,
...)
{
- CHAR Buffer[1024];
va_list argptr;
MachVideoHideShowTextCursor(FALSE);
@@ -205,11 +211,8 @@ FrLdrBugCheckWithMessage(
}
va_start(argptr, Format);
- _vsnprintf(Buffer, sizeof(Buffer), Format, argptr);
+ PrintTextV(Format, argptr);
va_end(argptr);
- Buffer[sizeof(Buffer) - 1] = 0;
-
- i386PrintText(Buffer);
_disable();
__halt();