Skip to content

Commit

Permalink
Switch string comparison to strcmp
Browse files Browse the repository at this point in the history
Apparently strcoll can change depending on environmental factors, which
is different from how CC:T functions, so we're using strcmp now.
  • Loading branch information
MCJack123 committed Dec 17, 2021
1 parent c9c4599 commit 521ba23
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/lvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ static int l_strcmp (const TString *ls, const TString *rs) {
const char *r = getstr(rs);
size_t lr = rs->tsv.len;
for (;;) {
int temp = strcoll(l, r);
int temp = strcmp(l, r);
if (temp != 0) return temp;
else { /* strings are equal up to a `\0' */
size_t len = strlen(l); /* index of first `\0' in both strings */
Expand All @@ -247,7 +247,6 @@ static int l_substrcmp (const TSubString *ls, const TSubString *rs) {
const char *r = getstr(rs->tss.str) + rs->tss.offset;
size_t lr = rs->tss.len;
for (;;) {
/* Unfortunately we cannot use strcoll here due to length, so use standard strncmp. */
int temp = strncmp(l, r, lr > ll ? ll : lr);
if (temp != 0) return temp;
else { /* strings are equal up to a `\0' */
Expand Down

0 comments on commit 521ba23

Please sign in to comment.