Skip to content

Commit 4b33d72

Browse files
committed
clean up
1 parent 0c83439 commit 4b33d72

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/netlicensing.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,15 @@ namespace netlicensing {
178178
//ttl returns with new line character ("\n") is appended at the end of the string and "\" at the begin of string.
179179
std::string ttl = fastWriter.write(root["ttl"]);
180180

181-
struct tm tm = {0};
182-
tm.tm_year = atoi(ttl.substr(1,4).c_str()) - 1900; /* years since 1900 */
183-
tm.tm_mon = atoi(ttl.substr(6, 2).c_str()) - 1;
184-
tm.tm_mday = atoi(ttl.substr(9, 2).c_str());
185-
tm.tm_hour = atoi(ttl.substr(12, 2).c_str());
186-
tm.tm_min = atoi(ttl.substr(15, 2).c_str());
187-
tm.tm_sec = atoi(ttl.substr(18, 2).c_str());
181+
struct tm ttlTime;
182+
ttlTime.tm_year = atoi(ttl.substr(1,4).c_str()) - 1900; /* years since 1900 */
183+
ttlTime.tm_mon = atoi(ttl.substr(6, 2).c_str()) - 1;
184+
ttlTime.tm_mday = atoi(ttl.substr(9, 2).c_str());
185+
ttlTime.tm_hour = atoi(ttl.substr(12, 2).c_str());
186+
ttlTime.tm_min = atoi(ttl.substr(15, 2).c_str());
187+
ttlTime.tm_sec = atoi(ttl.substr(18, 2).c_str());
188188

189-
time_t rawtime = mktime(&tm);
189+
time_t rawtime = mktime(&ttlTime);
190190
validationResult.setTtl(rawtime);
191191
}
192192

0 commit comments

Comments
 (0)