diff --git a/mongoose.c b/mongoose.c index 10beca39..4a0c9f68 100644 --- a/mongoose.c +++ b/mongoose.c @@ -3967,7 +3967,7 @@ void mg_sntp_request(struct mg_connection *c) { if (c->is_resolving) { MG_ERROR(("%lu wait until resolved", c->id)); } else { - uint64_t now = mg_millis(); + int64_t now = (int64_t) mg_millis(); // Use int64_t, for vc98 uint8_t buf[48] = {0}; uint32_t *t = (uint32_t *) &buf[40]; double frac = ((double) (now % 1000)) / 1000.0 * SNTP_MAX_FRAC; diff --git a/src/sntp.c b/src/sntp.c index a352622c..32195d35 100644 --- a/src/sntp.c +++ b/src/sntp.c @@ -59,7 +59,7 @@ void mg_sntp_request(struct mg_connection *c) { if (c->is_resolving) { MG_ERROR(("%lu wait until resolved", c->id)); } else { - uint64_t now = mg_millis(); + int64_t now = (int64_t) mg_millis(); // Use int64_t, for vc98 uint8_t buf[48] = {0}; uint32_t *t = (uint32_t *) &buf[40]; double frac = ((double) (now % 1000)) / 1000.0 * SNTP_MAX_FRAC;