summaryrefslogtreecommitdiff
path: root/MdePkg
diff options
context:
space:
mode:
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2007-09-20 06:40:26 +0000
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2007-09-20 06:40:26 +0000
commit457cfbaebcd7998264fed876e8c1872408e37242 (patch)
treec87debb6d92ce539ff94122896a8c2fb52955099 /MdePkg
parent179a2e9731c2d41d079bde81d624ef1667b00c44 (diff)
downloadedk2-platforms-457cfbaebcd7998264fed876e8c1872408e37242.tar.xz
Fix a bug to print correct message to ConOut and StdErr as they accept unicode string while DEBUG messages are all in Ascii
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3897 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Library/UefiDebugLibConOut/DebugLib.c9
-rw-r--r--MdePkg/Library/UefiDebugLibStdErr/DebugLib.c8
2 files changed, 13 insertions, 4 deletions
diff --git a/MdePkg/Library/UefiDebugLibConOut/DebugLib.c b/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
index 3cf31bd8a9..ff4de53729 100644
--- a/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
+++ b/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
@@ -53,6 +53,7 @@ DebugPrint (
)
{
CHAR16 Buffer[MAX_DEBUG_MESSAGE_LENGTH];
+ CHAR8 AsciiBuffer[MAX_DEBUG_MESSAGE_LENGTH];
VA_LIST Marker;
//
@@ -71,9 +72,11 @@ DebugPrint (
// Convert the DEBUG() message to a Unicode String
//
VA_START (Marker, Format);
- UnicodeVSPrintAsciiFormat (Buffer, sizeof (Buffer), Format, Marker);
+ AsciiVSPrint (AsciiBuffer, sizeof (AsciiBuffer), Format, Marker);
+ AsciiStrToUnicodeStr (AsciiBuffer, Buffer);
VA_END (Marker);
+
//
// Send the print string to the Console Output device
//
@@ -115,11 +118,13 @@ DebugAssert (
)
{
CHAR16 Buffer[MAX_DEBUG_MESSAGE_LENGTH];
+ CHAR8 AsciiBuffer[MAX_DEBUG_MESSAGE_LENGTH];
//
// Generate the ASSERT() message in Unicode format
//
- UnicodeSPrintAsciiFormat (Buffer, sizeof (Buffer), "ASSERT %s(%d): %s\n", FileName, LineNumber, Description);
+ AsciiSPrint (AsciiBuffer, sizeof (AsciiBuffer), "ASSERT %a(%d): %a\n", FileName, LineNumber, Description);
+ AsciiStrToUnicodeStr (AsciiBuffer, Buffer);
//
// Send the print string to the Console Output device
diff --git a/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c b/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
index 84ba61175f..50bb2bc50e 100644
--- a/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
+++ b/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
@@ -52,6 +52,7 @@ DebugPrint (
)
{
CHAR16 Buffer[MAX_DEBUG_MESSAGE_LENGTH];
+ CHAR8 AsciiBuffer[MAX_DEBUG_MESSAGE_LENGTH];
VA_LIST Marker;
//
@@ -70,7 +71,8 @@ DebugPrint (
// Convert the DEBUG() message to a Unicode String
//
VA_START (Marker, Format);
- UnicodeVSPrintAsciiFormat (Buffer, sizeof (Buffer), Format, Marker);
+ AsciiVSPrint (AsciiBuffer, sizeof (AsciiBuffer), Format, Marker);
+ AsciiStrToUnicodeStr (AsciiBuffer, Buffer);
VA_END (Marker);
//
@@ -114,11 +116,13 @@ DebugAssert (
)
{
CHAR16 Buffer[MAX_DEBUG_MESSAGE_LENGTH];
+ CHAR8 AsciiBuffer[MAX_DEBUG_MESSAGE_LENGTH];
//
// Generate the ASSERT() message in Unicode format
//
- UnicodeSPrintAsciiFormat (Buffer, sizeof (Buffer), "ASSERT %s(%d): %s\n", FileName, LineNumber, Description);
+ AsciiSPrint (AsciiBuffer, sizeof (AsciiBuffer), "ASSERT %a(%d): %a\n", FileName, LineNumber, Description);
+ AsciiStrToUnicodeStr (AsciiBuffer, Buffer);
//
// Send the print string to the Standard Error device