diff mbox series

core/artifacts_versions: Allow four numbers in the version string again

Message ID 20240316124236.7987-1-marcus.folkesson@gmail.com
State Accepted
Headers show
Series core/artifacts_versions: Allow four numbers in the version string again | expand

Commit Message

Marcus Folkesson March 16, 2024, 12:42 p.m. UTC
The forth number is ignored.
Fix so that version strings in the format <major>.<minor>.<rev>.<build> works again.

Can be verified by set four numbers as version and look for the following
ouput during update:
[DEBUG] : SWUPDATE running :  [version_to_number] : Version 10.0.2.0 had more than 4 numbers, trailing numbers will be ignored

Fixes: e1df95fa ("compare_versions: make is_oldstyle_version fail when number > 65535")

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
---
 core/artifacts_versions.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/core/artifacts_versions.c b/core/artifacts_versions.c
index 9695243a..3ac50351 100644
--- a/core/artifacts_versions.c
+++ b/core/artifacts_versions.c
@@ -174,7 +174,7 @@  static bool version_to_number(const char *version_string, __u64 *version_number)
 		}
 		version = (version << 16) | fld;
 	}
-	if (count >= 4) {
+	if (count > 4) {
 		DEBUG("Version %s had more than 4 numbers, trailing numbers will be ignored",
 		      version_string);
 	} else if (count > 0) {