MdeModulePkg/VariablePolicyLib: Use wildcard character constant

Makes the `#` character used for comparison against wildcard
characters in `CHAR16` strings to be prefixed with `L` so the
character is treated as a wide character constant.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
This commit is contained in:
Michael Kubacki 2024-07-19 19:29:33 -04:00 committed by mergify[bot]
parent 734aaff862
commit 469f29fe76
1 changed files with 2 additions and 2 deletions

View File

@ -178,7 +178,7 @@ IsValidVariablePolicyStructure (
WildcardCount = 0;
while (*CheckChar != CHAR_NULL) {
// Make sure there aren't excessive wildcards.
if (*CheckChar == '#') {
if (*CheckChar == L'#') {
WildcardCount++;
if (WildcardCount > MATCH_PRIORITY_MIN) {
return FALSE;
@ -263,7 +263,7 @@ EvaluatePolicyMatch (
// Keep going until the end of both strings.
while (PolicyName[Index] != CHAR_NULL || VariableName[Index] != CHAR_NULL) {
// If we don't have a match...
if ((PolicyName[Index] != VariableName[Index]) || (PolicyName[Index] == '#')) {
if ((PolicyName[Index] != VariableName[Index]) || (PolicyName[Index] == L'#')) {
// If this is a numerical wildcard, we can consider
// it a match if we alter the priority.
if ((PolicyName[Index] == L'#') &&