mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
No need to test end of numeric
This commit is contained in:
parent
988a3dd621
commit
2f86e0d107
6
nnn.c
6
nnn.c
|
@ -669,16 +669,14 @@ xstricmp(char *s1, char *s2)
|
||||||
else if (*c1 == '\0' && *c2 == '\0') {
|
else if (*c1 == '\0' && *c2 == '\0') {
|
||||||
static long long num1, num2;
|
static long long num1, num2;
|
||||||
|
|
||||||
num1 = strtoll(s1, &c1, 10);
|
num1 = strtoll(s1, NULL, 10);
|
||||||
num2 = strtoll(s2, &c2, 10);
|
num2 = strtoll(s2, NULL, 10);
|
||||||
if (num1 != num2) {
|
if (num1 != num2) {
|
||||||
if (num1 > num2)
|
if (num1 > num2)
|
||||||
return 1;
|
return 1;
|
||||||
else
|
else
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
*c1 = 0, *c2 = 0;
|
|
||||||
} else if (*c1 == '\0' && *c2 != '\0')
|
} else if (*c1 == '\0' && *c2 != '\0')
|
||||||
return -1;
|
return -1;
|
||||||
else if (*c1 != '\0' && *c2 == '\0')
|
else if (*c1 != '\0' && *c2 == '\0')
|
||||||
|
|
Loading…
Reference in a new issue