From 7b9b2b920e7e11de3b7d4c2b3c305aa4a41225ba Mon Sep 17 00:00:00 2001 From: lgao4 Date: Fri, 11 Dec 2009 11:01:50 +0000 Subject: [PATCH] Fix the bug for evaluate EFI_IFR_NOT_EQUAL_OP opcode, and the bug in using UnicodeSPrint function. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9554 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/SetupBrowserDxe/Expression.c | 2 +- MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c index 508a80524a..4bb1950668 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c @@ -1941,7 +1941,7 @@ EvaluateExpression ( break; case EFI_IFR_NOT_EQUAL_OP: - Value->Value.b = (BOOLEAN) ((Result == 0) ? TRUE : FALSE); + Value->Value.b = (BOOLEAN) ((Result != 0) ? TRUE : FALSE); break; case EFI_IFR_GREATER_EQUAL_OP: diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c b/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c index 3e7979f733..8b72d8fb03 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c @@ -455,12 +455,12 @@ TheKey2: // // Year // - UnicodeSPrint (FormattedNumber, 21 * sizeof (CHAR16), L"%04d", EditValue); + UnicodeSPrint (FormattedNumber, 21 * sizeof (CHAR16), L"%04d", (UINT16) EditValue); } else { // // Month/Day // - UnicodeSPrint (FormattedNumber, 21 * sizeof (CHAR16), L"%02d", EditValue); + UnicodeSPrint (FormattedNumber, 21 * sizeof (CHAR16), L"%02d", (UINT8) EditValue); } if (MenuOption->Sequence == 0) { @@ -469,7 +469,7 @@ TheKey2: FormattedNumber[EraseLen - 1] = DATE_SEPARATOR; } } else if (Question->Operand == EFI_IFR_TIME_OP) { - UnicodeSPrint (FormattedNumber, 21 * sizeof (CHAR16), L"%02d", EditValue); + UnicodeSPrint (FormattedNumber, 21 * sizeof (CHAR16), L"%02d", (UINT8) EditValue); if (MenuOption->Sequence == 0) { FormattedNumber[EraseLen - 2] = TIME_SEPARATOR;