summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2024-07-19 19:29:33 -0400
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-07-22 11:52:02 +0000
commit469f29fe7647c6dc8975a3c03ea7e181270d44d3 (patch)
treedad5aaa8e47aa68bf0cfa1e8cecd0163f6c9bc8b /MdeModulePkg
parent734aaff8625760fb5d38024168a5f8696b14fd10 (diff)
downloadedk2-469f29fe7647c6dc8975a3c03ea7e181270d44d3.tar.gz
edk2-469f29fe7647c6dc8975a3c03ea7e181270d44d3.tar.bz2
edk2-469f29fe7647c6dc8975a3c03ea7e181270d44d3.zip
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>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c b/MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c
index 768662829d..053b48d90e 100644
--- a/MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c
+++ b/MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c
@@ -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'#') &&