]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Console/TerminalDxe/Vtutf8.c
Small code refinement in MdeModulePkg.
[mirror_edk2.git] / MdeModulePkg / Universal / Console / TerminalDxe / Vtutf8.c
index 51cc093a41ad7b4ada7051e095609441e94da525..26fc13147a040aaf255dda636f3c145aac73da20 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Implementation of translation upon VT-UTF8.\r
 \r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -145,10 +145,11 @@ GetOneValidUtf8Char (
       // three-byte utf8 char go on\r
       //\r
       if ((Temp & 0xc0) == 0x80) {\r
-\r
-        Utf8Char->Utf8_3[2 - Index] = Temp;\r
-        Index++;\r
-        if (Index > 2) {\r
+        if (Index == 1) {\r
+          Utf8Char->Utf8_3[1] = Temp;\r
+          Index++;\r
+        } else {\r
+          Utf8Char->Utf8_3[0] = Temp;\r
           FetchFlag = FALSE;\r
         }\r
       } else {\r