GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still and

Commit 3e08dd9d authored by Nick Mathewson's avatar Nick Mathewson 🔬

Resolve a compiler warning from a 32-bit signed/unsigned comparison

This warning only affects platforms (like win32) with 32-bit time_t.

Fixes bug 40028; bugfix on
parent d9cc2b29
o Minor bugfixes (compiler warnings):
- Fix a compiler warning on platforms with 32-bit time_t values.
Fixes bug 40028; bugfix on
......@@ -23,6 +23,7 @@ tor_tls_pick_certificate_lifetime(time_t now,
time_t *start_time_out,
time_t *end_time_out)
tor_assert(cert_lifetime < INT_MAX);
time_t start_time, end_time;
/* Make sure we're part-way through the certificate lifetime, rather
* than having it start right now. Don't choose quite uniformly, since
......@@ -36,7 +37,7 @@ tor_tls_pick_certificate_lifetime(time_t now,
const time_t start_granularity = 24*3600;
time_t earliest_start_time;
/* Don't actually start in the future! */
if (cert_lifetime <= min_real_lifetime + start_granularity) {
if ((int)cert_lifetime <= min_real_lifetime + start_granularity) {
earliest_start_time = now - 1;
} else {
earliest_start_time = now + min_real_lifetime + start_granularity
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment