Revision: 18173
http://sourceforge.net/p/edk2/code/18173
Author: lersek
Date: 2015-08-06 10:13:33 +0000 (Thu, 06 Aug 2015)
Log Message:
-----------
OvmfPkg: PlatformDebugLibIoPort: fix AsciiSPrint() format string
The LineNumber parameter of the DebugAssert() function has type UINTN.
DebugAssert() passes it to AsciiSPrint() with the %d conversion specifier
at the moment, but %d would require an INT32 argument.
Fix this by casting LineNumber to UINT64, also employing the matching
decimal conversion specifier, %Lu.
(Another possibility would be to cast LineNumber to INT32, but a
UINTN->INT32 cast is not value preserving, generally speaking.)
Cc: Jordan Justen <[email protected]>
Cc: Scott Duplichan <[email protected]>
Reported-by: Scott Duplichan <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Modified Paths:
--------------
trunk/edk2/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c
Modified: trunk/edk2/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c
===================================================================
--- trunk/edk2/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c
2015-08-06 08:39:30 UTC (rev 18172)
+++ trunk/edk2/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c
2015-08-06 10:13:33 UTC (rev 18173)
@@ -134,7 +134,8 @@
//
// Generate the ASSERT() message in Ascii format
//
- AsciiSPrint (Buffer, sizeof (Buffer), "ASSERT %a(%d): %a\n", FileName,
LineNumber, Description);
+ AsciiSPrint (Buffer, sizeof Buffer, "ASSERT %a(%Lu): %a\n", FileName,
+ (UINT64)LineNumber, Description);
//
// Send the print string to the Console Output device
------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits