From 5c0337668f8bc7a2ea202d4a2bb9457d9a67160a Mon Sep 17 00:00:00 2001 From: niruiyu Date: Thu, 25 Nov 2010 07:04:04 +0000 Subject: [PATCH] Fix a bug in GetLangFromSupportedLangCodes() git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11091 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c | 5 +++++ MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c index b0644d6040..e0cd873f96 100644 --- a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c +++ b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c @@ -523,6 +523,11 @@ GetLangFromSupportedLangCodes ( return CopyMem (mVariableModuleGlobal->PlatformLang, Supported - CompareLength, CompareLength); } SubIndex++; + + // + // Skip ';' characters in Supported + // + for (; *Supported != '\0' && *Supported == ';'; Supported++); } } } diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c index 3431844472..8123338112 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c @@ -1199,6 +1199,11 @@ GetLangFromSupportedLangCodes ( return CopyMem (mVariableModuleGlobal->PlatformLang, Supported - CompareLength, CompareLength); } SubIndex++; + + // + // Skip ';' characters in Supported + // + for (; *Supported != '\0' && *Supported == ';'; Supported++); } } }