]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c
Fix AutoUpdateLangVariable() logic to handle the case PlatformLang/Lang is set before...
[mirror_edk2.git] / MdeModulePkg / Universal / SetupBrowserDxe / InputHandler.c
index b7c07e8d7ceb0d695fe479c9ad4dde51c16473b7..2905006856ac62573e589ecbe49c070a7234ff1c 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
 Implementation for handling user input from the User Interfaces.\r
 \r
-Copyright (c) 2004 - 2009, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2004 - 2009, 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
 http://opensource.org/licenses/bsd-license.php\r
@@ -12,7 +12,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#include "Ui.h"\r
 #include "Setup.h"\r
 \r
 \r
@@ -456,25 +455,29 @@ TheKey2:
               //\r
               // Year\r
               //\r
-              UnicodeSPrint (FormattedNumber, 21 * sizeof (CHAR16), L"%04d", EditValue);\r
+              UnicodeSPrint (FormattedNumber, 21 * sizeof (CHAR16), L"%04d", (UINT16) EditValue);\r
             } else {\r
               //\r
               // Month/Day\r
               //\r
-              UnicodeSPrint (FormattedNumber, 21 * sizeof (CHAR16), L"%02d", EditValue);\r
+              UnicodeSPrint (FormattedNumber, 21 * sizeof (CHAR16), L"%02d", (UINT8) EditValue);\r
             }\r
 \r
             if (MenuOption->Sequence == 0) {\r
+              ASSERT (EraseLen >= 2);\r
               FormattedNumber[EraseLen - 2] = DATE_SEPARATOR;\r
             } else if (MenuOption->Sequence == 1) {\r
+              ASSERT (EraseLen >= 1);\r
               FormattedNumber[EraseLen - 1] = DATE_SEPARATOR;\r
             }\r
           } else if (Question->Operand == EFI_IFR_TIME_OP) {\r
-            UnicodeSPrint (FormattedNumber, 21 * sizeof (CHAR16), L"%02d", EditValue);\r
+            UnicodeSPrint (FormattedNumber, 21 * sizeof (CHAR16), L"%02d", (UINT8) EditValue);\r
 \r
             if (MenuOption->Sequence == 0) {\r
+              ASSERT (EraseLen >= 2);\r
               FormattedNumber[EraseLen - 2] = TIME_SEPARATOR;\r
             } else if (MenuOption->Sequence == 1) {\r
+              ASSERT (EraseLen >= 1);\r
               FormattedNumber[EraseLen - 1] = TIME_SEPARATOR;\r
             }\r
           } else {\r
@@ -729,6 +732,7 @@ GetSelectionInputPopUp (
   Question = MenuOption->ThisTag;\r
   if (Question->Operand == EFI_IFR_ORDERED_LIST_OP) {\r
     ValueArray = Question->BufferValue;\r
+    ValueType = Question->ValueType;\r
     OrderedList = TRUE;\r
   } else {\r
     OrderedList = FALSE;\r