diff options
| author | Russell Belfer <rb@github.com> | 2013-06-13 15:26:56 -0700 |
|---|---|---|
| committer | Russell Belfer <rb@github.com> | 2013-06-17 10:03:48 -0700 |
| commit | c9b18018fd537566e76308fd2fec67e483b1d201 (patch) | |
| tree | da629fad3a4b7a3f1ee2331b7b9d101f209dace2 /src | |
| parent | e3b4a47c1ebd55931cb25bf5c2af821df9b0bffa (diff) | |
| download | libgit2-c9b18018fd537566e76308fd2fec67e483b1d201.tar.gz | |
Fix some warnings
Diffstat (limited to 'src')
| -rw-r--r-- | src/util.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/util.c b/src/util.c index 8536c9513..c543a3d21 100644 --- a/src/util.c +++ b/src/util.c @@ -283,17 +283,14 @@ int git__strcasesort_cmp(const char *a, const char *b) { int cmp = 0; - const char *orig_a = a; - const char *orig_b = b; - while (*a && *b) { - if (*a == *b) - ; - else if (tolower(*a) == tolower(*b)) { + if (*a != *b) { + if (tolower(*a) != tolower(*b)) + break; + /* use case in sort order even if not in equivalence */ if (!cmp) - cmp = (int)(*(const unsigned char *)a) - (int)(*(const unsigned char *)b); - } else - break; + cmp = (int)(*(const uint8_t *)a) - (int)(*(const uint8_t *)b); + } ++a, ++b; } |
