Merge pull request #209 from freifunk-gluon/autoupdater-fix-version-compare

autoupdater: fix version compare bugs
This commit is contained in:
Matthias Schiffer 2018-12-20 19:40:19 +01:00 committed by GitHub
commit a52d5ced54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -34,8 +34,10 @@ static int char_order(char c) {
return 0;
else if (isalpha(c))
return c;
else if (c == '~')
else if (c == '\0')
return -1;
else if (c == '~')
return -2;
else
return c + 256;
}
@ -47,7 +49,7 @@ bool newer_than(const char *a, const char *b) {
if (b == NULL)
return true;
while (*a != '\0' && *b != '\0') {
while (*a != '\0' || *b != '\0') {
int first_diff = 0;
// compare non-digits character by character