projects
/
mirror_edk2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
MdePkg/BasePrintLib: Fix incomplete print output
[mirror_edk2.git]
/
MdePkg
/
Library
/
BasePrintLib
/
PrintLibInternal.c
diff --git
a/MdePkg/Library/BasePrintLib/PrintLibInternal.c
b/MdePkg/Library/BasePrintLib/PrintLibInternal.c
index fc57255068485222fce76ea5b94b6c80d2556943..6f19b314496b4b190df386697d5e53fc5fda6080 100644
(file)
--- a/
MdePkg/Library/BasePrintLib/PrintLibInternal.c
+++ b/
MdePkg/Library/BasePrintLib/PrintLibInternal.c
@@
-1108,7
+1108,9
@@
BasePrintLibSPrintMarker (
// ArgumentString is either null-terminated, or it contains Precision characters
\r
//
\r
for (Count = 0;
\r
// ArgumentString is either null-terminated, or it contains Precision characters
\r
//
\r
for (Count = 0;
\r
- ArgumentString[Count * BytesPerArgumentCharacter] != '\0' &&
\r
+ (ArgumentString[Count * BytesPerArgumentCharacter] != '\0' ||
\r
+ (BytesPerArgumentCharacter > 1 &&
\r
+ ArgumentString[Count * BytesPerArgumentCharacter + 1]!= '\0')) &&
\r
(Count < Precision || ((Flags & PRECISION) == 0));
\r
Count++) {
\r
ArgumentCharacter = ((ArgumentString[Count * BytesPerArgumentCharacter] & 0xff) | ((ArgumentString[Count * BytesPerArgumentCharacter + 1]) << 8)) & ArgumentMask;
\r
(Count < Precision || ((Flags & PRECISION) == 0));
\r
Count++) {
\r
ArgumentCharacter = ((ArgumentString[Count * BytesPerArgumentCharacter] & 0xff) | ((ArgumentString[Count * BytesPerArgumentCharacter + 1]) << 8)) & ArgumentMask;
\r
@@
-1167,7
+1169,9
@@
BasePrintLibSPrintMarker (
//
\r
// Copy the string into the output buffer performing the required type conversions
\r
//
\r
//
\r
// Copy the string into the output buffer performing the required type conversions
\r
//
\r
- while (Index < Count && (*ArgumentString) != '\0') {
\r
+ while (Index < Count &&
\r
+ (ArgumentString[0] != '\0' ||
\r
+ (BytesPerArgumentCharacter > 1 && ArgumentString[1] != '\0'))) {
\r
ArgumentCharacter = ((*ArgumentString & 0xff) | (((UINT8)*(ArgumentString + 1)) << 8)) & ArgumentMask;
\r
\r
LengthToReturn += (1 * BytesPerOutputCharacter);
\r
ArgumentCharacter = ((*ArgumentString & 0xff) | (((UINT8)*(ArgumentString + 1)) << 8)) & ArgumentMask;
\r
\r
LengthToReturn += (1 * BytesPerOutputCharacter);
\r