summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-10-13 02:31:58 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-10-13 02:31:58 +0000
commit90f6df07f8a800352bb5402166b050eee804789e (patch)
treed49881605f572538f674091bfb18a2ae1b73929d /MdeModulePkg
parent87200170b3b4c1886b77271e8ec422624eb1aca6 (diff)
downloadedk2-platforms-90f6df07f8a800352bb5402166b050eee804789e.tar.xz
Refine code and check null pointer error.
Signed-off-by: ydong10 Reviewed-by: mdkinney git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12532 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Universal/HiiDatabaseDxe/String.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/String.c b/MdeModulePkg/Universal/HiiDatabaseDxe/String.c
index 617ba54509..52d348c572 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/String.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/String.c
@@ -1972,20 +1972,16 @@ AsciiHiiToLower (
IN CHAR8 *ConfigString
)
{
- CHAR8 *String;
-
ASSERT (ConfigString != NULL);
//
// Convert all hex digits in range [A-F] in the configuration header to [a-f]
//
- for (String = ConfigString; *String != '\0'; String++) {
- if ( *String >= 'A' && *String <= 'Z') {
- *String = (CHAR8) (*String - 'A' + 'a');
+ for (; *ConfigString != '\0'; ConfigString++) {
+ if ( *ConfigString >= 'A' && *ConfigString <= 'Z') {
+ *ConfigString = (CHAR8) (*ConfigString - 'A' + 'a');
}
}
-
- return;
}
/**
@@ -2014,11 +2010,13 @@ HiiCompareLanguage (
//
StrLen = AsciiStrSize (Language1);
Lan1 = AllocateZeroPool (StrLen);
+ ASSERT (Lan1 != NULL);
AsciiStrCpy(Lan1, Language1);
AsciiHiiToLower (Lan1);
StrLen = AsciiStrSize (Language2);
Lan2 = AllocateZeroPool (StrLen);
+ ASSERT (Lan2 != NULL);
AsciiStrCpy(Lan2, Language2);
AsciiHiiToLower (Lan2);