Skip to content

Commit

Permalink
fix: checksum suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisAMJ committed May 11, 2024
1 parent 89b655c commit 30977aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ config.txt
errors.txt
output.txt
config.mk
.vscode/*
10 changes: 6 additions & 4 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,12 @@ int config_check_var_whitelist(struct var_whitelist *list, const char *var, cons
if (!list) return false;
bool found = false;
while (list->var_name) {
if (!strcmp(list->var_name, var)) {
found = true;
if (!list->val) return 2; // matching
if (!strcmp(list->val, val)) return 2; // matching
if (strlen(var) >= strlen(list->var_name)) {
if (!strcmp(var + strlen(var) - strlen(list->var_name), list->var_name)) {
found = true;
if (!list->val) return 2; // matching
if (!strcmp(list->val, val)) return 2; // matching
}
}
++list;
}
Expand Down

0 comments on commit 30977aa

Please sign in to comment.