]> git.proxmox.com Git - mirror_edk2.git/commitdiff
StdLib/LibC/Uefi/Devices/Console/daConsole.c: Fix bug where unconvertable wide chara...
authordarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 18 Jul 2012 18:23:25 +0000 (18:23 +0000)
committerdarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 18 Jul 2012 18:23:25 +0000 (18:23 +0000)
When the WideTtyCvt() function encountered an unconvertable character, it properly replaced it but did not update the byte count, numB, to 1 and instead left it at -1.

This fix sets numB to 1 when an unconvertable character is replaced.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: tim.lewis@insidesw.com
Reviewed-by: daryl.mcdaniel@intel.com
Reviewed-by: erik.c.bjorge@intel.com
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13540 6f19259b-4bc3-4df7-8a09-765794883524

StdLib/LibC/Uefi/Devices/Console/daConsole.c

index bfcc4a292c71b8783ef816798c35dc59d40ba60c..4897a2e56e639476a7c041d5b686f6bdce2c4f24 100644 (file)
@@ -77,8 +77,9 @@ WideTtyCvt( CHAR16 *dest, const char *buf, ssize_t n, mbstate_t *Cs)
     if( numB == 0) {\r
       break;\r
     };\r
-    if(numB < 0) {\r
+    if(numB < 0) {    // If an unconvertable character, replace it.\r
       wc[0] = BLOCKELEMENT_LIGHT_SHADE;\r
+      numB = 1;\r
     }\r
     if(wc[0] == L'\n') {\r
       *dest++ = L'\r';\r