curl / Mailing Lists / curl-library / Single Mail


prefer time_t to long

From: Daniel Stenberg <>
Date: Fri, 11 Nov 2016 10:42:41 +0100 (CET)

Hey folks,

I stumbled over this old code of ours that use 'long' to store number of
seconds and number of milliseconds, while I think 'time_t' should be a better
type for modern machines. Mostly because time_t is as large on 64 bits nix
machines and long is still only 32 bits on Windows machines.

I'm thus suggesting the attached patch to transition some longs over to time_t
to reduce the risk of integer overflows or truncating on windows.


List admin:

Received on 2016-11-11