diff --git a/src/lib/version/version.c b/src/lib/version/version.c index 4735038339..83b2680be5 100644 --- a/src/lib/version/version.c +++ b/src/lib/version/version.c @@ -83,13 +83,17 @@ static uint32_t version_tag_to_number(const char *tag) if (tag[i] >= '0' && tag[i] <= '9') { if (mag < 32) { - unsigned number = tag[i] - '0'; + char number = tag[i] - '0'; ver += (number << mag); - mag += 8; + mag += 4; } } else if (tag[i] == '.') { + if (mag % 8) { + mag += 4; + } + continue; } else if (i > 3 && type == -1) { diff --git a/src/systemcmds/ver/ver.c b/src/systemcmds/ver/ver.c index 1bc497f122..9041d7ee24 100644 --- a/src/systemcmds/ver/ver.c +++ b/src/systemcmds/ver/ver.c @@ -128,10 +128,10 @@ int ver_main(int argc, char *argv[]) unsigned type = (fwver >> (8 * 0)) & 0xFF; if (type == 255) { - printf("FW version: Release %u.%u.%u (%u)\n", major, minor, patch, fwver); + printf("FW version: Release %x.%x.%x (%u)\n", major, minor, patch, fwver); } else { - printf("FW version: %u.%u.%u %u (%u)\n", major, minor, patch, type, fwver); + printf("FW version: %x.%x.%x %x (%u)\n", major, minor, patch, type, fwver); } @@ -143,10 +143,10 @@ int ver_main(int argc, char *argv[]) printf("OS: %s\n", px4_os_name()); if (type == 255) { - printf("OS version: Release %u.%u.%u (%u)\n", major, minor, patch, fwver); + printf("OS version: Release %x.%x.%x (%u)\n", major, minor, patch, fwver); } else { - printf("OS version: %u.%u.%u %u (%u)\n", major, minor, patch, type, fwver); + printf("OS version: %x.%x.%x %x (%u)\n", major, minor, patch, type, fwver); } const char *os_git_hash = px4_os_version_string();