commit 2df9740f6c8bfe691bccadf4e87aec7a78d4f81f
parent b2f2a6fe76bdbba48c0174b4f1eb05caf1a74b71
Author: Lazaros Koromilas <lostd@2f30.org>
Date: Mon, 8 Apr 2019 12:59:12 +0300
Use unsigned semantics in char comparison
Unicode entries appear in the same order as with default sorting.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/strverscmp.c b/strverscmp.c
@@ -11,8 +11,8 @@ strverscmp(const char *str1, const char *str2)
size_t i1 = 0;
size_t i2 = 0;
for (; i1 < len1 && i2 < len2; i1++, i2++) {
- char c1 = str1[i1];
- char c2 = str2[i2];
+ unsigned char c1 = str1[i1];
+ unsigned char c2 = str2[i2];
if (isdigit(c1) && isdigit(c2)) {
unsigned long long int num1;
unsigned long long int num2;