diff options
author | Laszlo Ersek <lersek@redhat.com> | 2015-08-06 10:13:33 +0000 |
---|---|---|
committer | lersek <lersek@Edk2> | 2015-08-06 10:13:33 +0000 |
commit | 3d8ac52a5d8df67555dc1bdba42d09c682cd71a9 (patch) | |
tree | e617a9b3e06ea3bac1fcf4042df891026e028864 /OvmfPkg/Library/PlatformDebugLibIoPort | |
parent | 8f227c2fd97c8160c6e3f99c532d778942efaf62 (diff) | |
download | edk2-3d8ac52a5d8df67555dc1bdba42d09c682cd71a9.zip edk2-3d8ac52a5d8df67555dc1bdba42d09c682cd71a9.tar.gz edk2-3d8ac52a5d8df67555dc1bdba42d09c682cd71a9.tar.bz2 |
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 <jordan.l.justen@intel.com>
Cc: Scott Duplichan <scott@notabs.org>
Reported-by: Scott Duplichan <scott@notabs.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18173 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg/Library/PlatformDebugLibIoPort')
-rw-r--r-- | OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c b/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c index 585f9fb..44850a9 100644 --- a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c +++ b/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c @@ -134,7 +134,8 @@ DebugAssert ( //
// 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
|