From cfa8d77231f6744dbe70cc0223fe39093c9f262d Mon Sep 17 00:00:00 2001 From: tizzybec <tizzybec@outlook.com> Date: 周三, 12 6月 2019 11:40:30 +0800 Subject: [PATCH] rename LOG_ENABLED to LOG_DISABLED --- src/library/LicenseReader.cpp | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/library/LicenseReader.cpp b/src/library/LicenseReader.cpp index 2c6a179..06a068c 100644 --- a/src/library/LicenseReader.cpp +++ b/src/library/LicenseReader.cpp @@ -18,6 +18,7 @@ #include <fstream> #include <sstream> #include <stdlib.h> +#include <math.h> #include "pc-identifiers.h" #include "LicenseReader.h" #include "base/StringUtils.h" @@ -89,11 +90,11 @@ license->expiry_date[0] = '\0'; license->days_left = 999999; } else { - strncpy(license->expiry_date, to_date.c_str(), 11-1); + strncpy(license->expiry_date, to_date.c_str(), 11); double secs = difftime( seconds_from_epoch(to_date.c_str()), time(NULL)); - license->days_left = (int) secs / 60 * 60 * 24; + license->days_left = round(secs / (60 * 60 * 24)); } } } @@ -160,9 +161,11 @@ FullLicenseInfo::UNUSED_SOFTWARE_VERSION); int to_sw_version = ini.GetLongValue(productNamePtr, "to_sw_version", FullLicenseInfo::UNUSED_SOFTWARE_VERSION); + string extra_data = trim_copy( + ini.GetValue(productNamePtr, "extra_data", "")); FullLicenseInfo licInfo(*it, product, license_signature, (int) license_version, from_date, to_date, client_signature, - from_sw_version, to_sw_version); + from_sw_version, to_sw_version, extra_data); licenseInfoOut.push_back(licInfo); atLeastOneLicenseComplete = true; } else { -- Gitblit v1.9.1