修复bug

This commit is contained in:
tursom 2018-02-16 14:17:28 +08:00
parent 9cb4de7fbb
commit 4ee5bf6f1a

2
main.c
View File

@ -85,7 +85,7 @@ unsigned int getPrimeNumbers(
*
*/
int str_smaller(char *s1, char *s2) {
return *s2 == '-' || strlen(s1) < strlen(s2) || strcmp(s1, s2) < 0;
return !(*s2 != '-' || strlen(s1) > strlen(s2) || strcmp(s1, s2) > 0);
}
/*