mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-09-23 15:05:05 +02:00
fix version string
This commit is contained in:
parent
7aa451bec1
commit
493cc4fe4f
1 changed files with 13 additions and 4 deletions
|
@ -1563,10 +1563,19 @@ void CentralDB::onlineNotificationThread()
|
||||||
std::string arch = "unknown";
|
std::string arch = "unknown";
|
||||||
std::string frontend = member["frontend"].get<std::string>();
|
std::string frontend = member["frontend"].get<std::string>();
|
||||||
|
|
||||||
std::string vMajor = OSUtils::jsonString(member["vMajor"], "0");
|
int vMajor = OSUtils::jsonInt(member["vMajor"], 0);
|
||||||
std::string vMinor = OSUtils::jsonString(member["vMinor"], "0");
|
int vMinor = OSUtils::jsonInt(member["vMinor"], 0);
|
||||||
std::string vRev = OSUtils::jsonString(member["vRev"], "0");
|
int vRev = OSUtils::jsonInt(member["vRev"], 0);
|
||||||
std::string version = "v" + vMajor + "." + vMinor + "." + vRev;
|
std::string version;
|
||||||
|
if (vMajor <= 0 && vMinor <= 0 && vRev <= 0) {
|
||||||
|
vMajor = 0;
|
||||||
|
vMinor = 0;
|
||||||
|
vRev = 0;
|
||||||
|
version = "unknown";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
version = "v" + std::to_string(vMajor) + "." + std::to_string(vMinor) + "." + std::to_string(vRev);
|
||||||
|
}
|
||||||
if (osArchSplit.size() == 2) {
|
if (osArchSplit.size() == 2) {
|
||||||
os = osArchSplit[0];
|
os = osArchSplit[0];
|
||||||
arch = osArchSplit[1];
|
arch = osArchSplit[1];
|
||||||
|
|
Loading…
Add table
Reference in a new issue