From 372285d1fc420da6c9da9f3a1856d16f37e557d4 Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Fri, 25 Jan 2008 03:14:35 +0000 Subject: 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 --- MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'MdeModulePkg') diff --git a/MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c b/MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c index 78c95737a4..777c844578 100644 --- a/MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c +++ b/MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c @@ -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), -- cgit v1.2.3