Skip to content

Commit

Permalink
Merge pull request #209 from freifunk-gluon/autoupdater-fix-version-c…
Browse files Browse the repository at this point in the history
…ompare

autoupdater: fix version compare bugs
  • Loading branch information
neocturne committed Dec 20, 2018
2 parents 1dc8416 + 30be52e commit a52d5ce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions admin/autoupdater/src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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
Expand Down

0 comments on commit a52d5ce

Please sign in to comment.