diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index b9be442f..56e7ca59 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -721,7 +721,7 @@ LWS_VISIBLE void lwsl_emit_stderr(int level, const char *line) for (n = 0; n < LLL_COUNT; n++) if (level == (1 << n)) { now = time_in_microseconds() / 100; - sprintf(buf, "[%lu:%04d] %s: ", (unsigned long) now / 10000, + sprintf(buf, "[%llu:%04d] %s: ", (unsigned long long) now / 10000, (int)(now % 10000), log_level_names[n]); break; } diff --git a/lib/lws-plat-unix.c b/lib/lws-plat-unix.c index 9af4bdfd..1b831878 100644 --- a/lib/lws-plat-unix.c +++ b/lib/lws-plat-unix.c @@ -8,7 +8,7 @@ unsigned long long time_in_microseconds(void) { struct timeval tv; gettimeofday(&tv, NULL); - return (tv.tv_sec * 1000000) + tv.tv_usec; + return ((unsigned long long)tv.tv_sec * 1000000LL) + tv.tv_usec; } LWS_VISIBLE int libwebsockets_get_random(struct libwebsocket_context *context,