Browse Source

msk: fix bad version comparison function

K. Lange 2 years ago
parent
commit
3d1f2cfcc3
1 changed files with 6 additions and 2 deletions
  1. 6 2
      apps/msk.c

+ 6 - 2
apps/msk.c

@@ -46,8 +46,12 @@ static int compare_version_strings(char * current, char * candidate) {
 	sscanf(current, "%d.%d.%d", &current_x, &current_y, &current_z);
 	sscanf(candidate, "%d.%d.%d", &candidate_x, &candidate_y, &candidate_z);
 
-	if (candidate_x >= current_x) {
-		if (candidate_y >= current_y) {
+	if (candidate_x > current_x) {
+		return 1;
+	} else if (candidate_x == current_x) {
+		if (candidate_y >current_y) {
+			return 1;
+		} else if (candidate_y == current_y) {
 			if (candidate_z > current_z) {
 				return 1;
 			} else if (candidate_z == current_z) {