Fix two issues:

1. The default with of hex value is 0 according to MdeLib spec. If we expect it to be 16, we need to state it in the format string explicitly.
2. For UnicodeSPrint, the output buffer size of 0 will not print anything to the buffer according to MdeLib spec. We need to specify the maximum possible buffer size.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4635 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qhuang8 2008-01-25 03:14:35 +00:00
parent 0c0e0a041d
commit 372285d1fc
1 changed files with 2 additions and 2 deletions

View File

@ -440,11 +440,11 @@ EisaIdToText (
//
//UnicodeSPrint ("%X", 0x0a03) => "0000000000000A03"
//
UnicodeSPrint (PnpIdStr, 17 * 2, L"%X", EisaId >> 16);
UnicodeSPrint (PnpIdStr, 17 * 2, L"%16X", EisaId >> 16);
UnicodeSPrint (
Text,
0,
sizeof (CHAR16) + sizeof (CHAR16) + sizeof (CHAR16) + sizeof (PnpIdStr),
L"%c%c%c%s",
'@' + ((EisaId >> 10) & 0x1f),
'@' + ((EisaId >> 5) & 0x1f),