Skip to content

Commit

Permalink
Fix UB
Browse files Browse the repository at this point in the history
  • Loading branch information
AMDmi3 committed Feb 12, 2019
1 parent b764362 commit 5252d6e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libversion/compare.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ enum {
};

static int mymemcasecmp(const char* a, const char* b, size_t len) {
while (len-- != 0) {
while (len != 0) {
unsigned char ua = (unsigned char)((*a >= 'A' && *a <= 'Z') ? (*a - 'A' + 'a') : (*a));
unsigned char ub = (unsigned char)((*b >= 'A' && *b <= 'Z') ? (*b - 'A' + 'a') : (*b));

Expand All @@ -76,6 +76,7 @@ static int mymemcasecmp(const char* a, const char* b, size_t len) {

a++;
b++;
len--;
}

return 0;
Expand Down

0 comments on commit 5252d6e

Please sign in to comment.