summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Library/UefiHiiLib/HiiString.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Library/UefiHiiLib/HiiString.c')
-rw-r--r--MdeModulePkg/Library/UefiHiiLib/HiiString.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiString.c b/MdeModulePkg/Library/UefiHiiLib/HiiString.c
index 078811e835..2c586ef64d 100644
--- a/MdeModulePkg/Library/UefiHiiLib/HiiString.c
+++ b/MdeModulePkg/Library/UefiHiiLib/HiiString.c
@@ -7,7 +7,6 @@
**/
-
#include "InternalHiiLib.h"
/**
@@ -57,10 +56,10 @@ HiiSetString (
IN CONST CHAR8 *SupportedLanguages OPTIONAL
)
{
- EFI_STATUS Status;
- CHAR8 *AllocatedLanguages;
- CHAR8 *Supported;
- CHAR8 *Language;
+ EFI_STATUS Status;
+ CHAR8 *AllocatedLanguages;
+ CHAR8 *Supported;
+ CHAR8 *Language;
ASSERT (HiiHandle != NULL);
ASSERT (String != NULL);
@@ -97,12 +96,14 @@ HiiSetString (
//
// Search for the next language separator and replace it with a Null-terminator
//
- for (; *Supported != 0 && *Supported != ';'; Supported++);
+ for ( ; *Supported != 0 && *Supported != ';'; Supported++) {
+ }
+
if (*Supported != 0) {
*(Supported++) = '\0';
}
- if ((SupportedLanguages == NULL) && AsciiStrnCmp (Language, UEFI_CONFIG_LANG, AsciiStrLen (UEFI_CONFIG_LANG)) == 0) {
+ if ((SupportedLanguages == NULL) && (AsciiStrnCmp (Language, UEFI_CONFIG_LANG, AsciiStrLen (UEFI_CONFIG_LANG)) == 0)) {
//
// Skip string package used for keyword protocol.
//
@@ -138,7 +139,6 @@ HiiSetString (
}
}
-
/**
Retrieves a string from a string package names by GUID in a specific language.
If the language is not specified, then a string from a string package in the
@@ -292,7 +292,7 @@ HiiGetStringEx (
//
// Get the current platform language setting
//
- GetEfiGlobalVariable2 (L"PlatformLang", (VOID**)&PlatformLanguage, NULL);
+ GetEfiGlobalVariable2 (L"PlatformLang", (VOID **)&PlatformLanguage, NULL);
//
// If Languag is NULL, then set it to an empty string, so it will be
@@ -318,23 +318,22 @@ HiiGetStringEx (
goto Error;
}
} else {
- BestLanguage = (CHAR8 *) Language;
+ BestLanguage = (CHAR8 *)Language;
}
-
//
// Retrieve the size of the string in the string package for the BestLanguage
//
StringSize = 0;
- Status = gHiiString->GetString (
- gHiiString,
- BestLanguage,
- HiiHandle,
- StringId,
- &TempString,
- &StringSize,
- NULL
- );
+ Status = gHiiString->GetString (
+ gHiiString,
+ BestLanguage,
+ HiiHandle,
+ StringId,
+ &TempString,
+ &StringSize,
+ NULL
+ );
//
// If GetString() returns EFI_SUCCESS for a zero size,
// then there are no supported languages registered for HiiHandle. If GetString()
@@ -380,10 +379,12 @@ Error:
if (SupportedLanguages != NULL) {
FreePool (SupportedLanguages);
}
+
if (PlatformLanguage != NULL) {
FreePool (PlatformLanguage);
}
- if (TryBestLanguage && BestLanguage != NULL) {
+
+ if (TryBestLanguage && (BestLanguage != NULL)) {
FreePool (BestLanguage);
}