curl / Mailing Lists / curl-library / Single Mail

curl-library

prefer time_t to long

From: Daniel Stenberg <daniel_at_haxx.se>
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.

-- 
  / daniel.haxx.se


-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html

Received on 2016-11-11