Revision: 13540
          http://edk2.svn.sourceforge.net/edk2/?rev=13540&view=rev
Author:   darylm503
Date:     2012-07-18 18:23:25 +0000 (Wed, 18 Jul 2012)
Log Message:
-----------
StdLib/LibC/Uefi/Devices/Console/daConsole.c:  Fix bug where unconvertable wide 
characters would cause the code to hang or generate an exception.

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: [email protected]
Reviewed-by: [email protected]
Reviewed-by: [email protected]

Modified Paths:
--------------
    trunk/edk2/StdLib/LibC/Uefi/Devices/Console/daConsole.c

Modified: trunk/edk2/StdLib/LibC/Uefi/Devices/Console/daConsole.c
===================================================================
--- trunk/edk2/StdLib/LibC/Uefi/Devices/Console/daConsole.c     2012-07-18 
09:32:05 UTC (rev 13539)
+++ trunk/edk2/StdLib/LibC/Uefi/Devices/Console/daConsole.c     2012-07-18 
18:23:25 UTC (rev 13540)
@@ -77,8 +77,9 @@
     if( numB == 0) {
       break;
     };
-    if(numB < 0) {
+    if(numB < 0) {    // If an unconvertable character, replace it.
       wc[0] = BLOCKELEMENT_LIGHT_SHADE;
+      numB = 1;
     }
     if(wc[0] == L'\n') {
       *dest++ = L'\r';

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to