break;\r
}\r
//\r
- // Get Width by OneOf Flags\r
+ // Get the Max size of the string.\r
//\r
Width = (UINT16) (IfrString->MaxSize * sizeof (UINT16));\r
if (NameValueType) {\r
//\r
break;\r
}\r
+ //\r
+ // Skip the VarName.\r
+ //\r
+ StringPtr += StrLen (QuestionName);\r
\r
//\r
// Skip the "=".\r
\r
//\r
// Check current string length is less than maxsize\r
+ // e.g Config String: "0041004200430044", Unicode String: "ABCD". Unicode String length = Config String length / 4.\r
+ // Config string format in UEFI spec.\r
+ // <NvConfig> ::= <Label>'='<String>\r
+ // <String> ::= [<Char>]+\r
+ // <Char> ::= <HexCh>4\r
//\r
- if (StrSize (StringPtr) > Width) {\r
+ if (StrLen (StringPtr) / 4 > IfrString->MaxSize) {\r
return EFI_INVALID_PARAMETER;\r
}\r
} else {\r
//\r
// Check current string length is less than maxsize\r
//\r
- if (StrSize ((CHAR16 *) (VarBuffer + Offset)) > Width) {\r
+ if (StrLen ((CHAR16 *) (VarBuffer + Offset)) > IfrString->MaxSize) {\r
return EFI_INVALID_PARAMETER;\r
}\r
}\r