summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/BasePrintLib/PrintLib.c
diff options
context:
space:
mode:
authorAJFISH <AJFISH@6f19259b-4bc3-4df7-8a09-765794883524>2007-09-01 15:56:49 +0000
committerAJFISH <AJFISH@6f19259b-4bc3-4df7-8a09-765794883524>2007-09-01 15:56:49 +0000
commite7fe49961ab6d2d08e072775eb7c2d3be5d8a5ca (patch)
tree14e2db8157434f5c2b79439b9eba5367f958eb70 /MdePkg/Library/BasePrintLib/PrintLib.c
parent8fb6b714d3c21c11243e4a8a75215a690f2b2857 (diff)
downloadedk2-e7fe49961ab6d2d08e072775eb7c2d3be5d8a5ca.tar.gz
edk2-e7fe49961ab6d2d08e072775eb7c2d3be5d8a5ca.tar.bz2
edk2-e7fe49961ab6d2d08e072775eb7c2d3be5d8a5ca.zip
Fixed problem with sign extension in print lib. PrintXY could not print out French characters like é.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3761 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/BasePrintLib/PrintLib.c')
-rw-r--r--MdePkg/Library/BasePrintLib/PrintLib.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/MdePkg/Library/BasePrintLib/PrintLib.c b/MdePkg/Library/BasePrintLib/PrintLib.c
index 80408a5ba5..145ca3494a 100644
--- a/MdePkg/Library/BasePrintLib/PrintLib.c
+++ b/MdePkg/Library/BasePrintLib/PrintLib.c
@@ -154,7 +154,7 @@ BasePrintLibVSPrint (
//
// Get the first character from the format string
//
- FormatCharacter = (*Format | (*(Format + 1) << 8)) & FormatMask;
+ FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
//
// Loop until the end of the format string is reached or the output buffer is full
@@ -183,7 +183,7 @@ BasePrintLibVSPrint (
//
for (Done = FALSE; !Done; ) {
Format += BytesPerFormatCharacter;
- FormatCharacter = (*Format | (*(Format + 1) << 8)) & FormatMask;
+ FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
switch (FormatCharacter) {
case '.':
Flags |= PRECISION;
@@ -228,7 +228,7 @@ BasePrintLibVSPrint (
for (Count = 0; ((FormatCharacter >= '0') && (FormatCharacter <= '9')); ){
Count = (Count * 10) + FormatCharacter - '0';
Format += BytesPerFormatCharacter;
- FormatCharacter = (*Format | (*(Format + 1) << 8)) & FormatMask;
+ FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
}
Format -= BytesPerFormatCharacter;
if ((Flags & PRECISION) == 0) {
@@ -548,7 +548,7 @@ BasePrintLibVSPrint (
//
// Get the next character from the format string
//
- FormatCharacter = (*Format | (*(Format + 1) << 8)) & FormatMask;
+ FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
}
//