]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fixed problem with sign extension in print lib. PrintXY could not print out French...
authorAJFISH <AJFISH@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 1 Sep 2007 15:56:49 +0000 (15:56 +0000)
committerAJFISH <AJFISH@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 1 Sep 2007 15:56:49 +0000 (15:56 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3761 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/BasePrintLib/PrintLib.c

index 80408a5ba5e5c2602a26a485a56380b081f77dbc..145ca3494aa73d8ae4951e00d615dd8d37323bef 100644 (file)
@@ -154,7 +154,7 @@ BasePrintLibVSPrint (
   //\r
   // Get the first character from the format string\r
   //\r
   //\r
   // Get the first character from the format string\r
   //\r
-  FormatCharacter = (*Format | (*(Format + 1) << 8)) & FormatMask;\r
+  FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;\r
 \r
   //\r
   // Loop until the end of the format string is reached or the output buffer is full\r
 \r
   //\r
   // Loop until the end of the format string is reached or the output buffer is full\r
@@ -183,7 +183,7 @@ BasePrintLibVSPrint (
       //\r
       for (Done = FALSE; !Done; ) {\r
         Format += BytesPerFormatCharacter;\r
       //\r
       for (Done = FALSE; !Done; ) {\r
         Format += BytesPerFormatCharacter;\r
-        FormatCharacter = (*Format | (*(Format + 1) << 8)) & FormatMask;\r
+        FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;\r
         switch (FormatCharacter) {\r
         case '.': \r
           Flags |= PRECISION; \r
         switch (FormatCharacter) {\r
         case '.': \r
           Flags |= PRECISION; \r
@@ -228,7 +228,7 @@ BasePrintLibVSPrint (
           for (Count = 0; ((FormatCharacter >= '0') &&  (FormatCharacter <= '9')); ){\r
             Count = (Count * 10) + FormatCharacter - '0';\r
             Format += BytesPerFormatCharacter;\r
           for (Count = 0; ((FormatCharacter >= '0') &&  (FormatCharacter <= '9')); ){\r
             Count = (Count * 10) + FormatCharacter - '0';\r
             Format += BytesPerFormatCharacter;\r
-            FormatCharacter = (*Format | (*(Format + 1) << 8)) & FormatMask;\r
+            FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;\r
           }\r
           Format -= BytesPerFormatCharacter;\r
           if ((Flags & PRECISION) == 0) {\r
           }\r
           Format -= BytesPerFormatCharacter;\r
           if ((Flags & PRECISION) == 0) {\r
@@ -548,7 +548,7 @@ BasePrintLibVSPrint (
     //\r
     // Get the next character from the format string\r
     //\r
     //\r
     // Get the next character from the format string\r
     //\r
-    FormatCharacter = (*Format | (*(Format + 1) << 8)) & FormatMask;\r
+    FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;\r
   }\r
 \r
   //\r
   }\r
 \r
   //\r