lib: use correct printf flags for sockets and timediffs

Introduces CURL_FORMAT_SOCKET_T for outputting socket numbers.

Fixes #10737
Reported-by: Gisle Vanem
Closes #10855
This commit is contained in:
Daniel Stenberg 2023-03-28 16:46:03 +02:00
parent 9a607fd728
commit 8455013359
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
5 changed files with 51 additions and 20 deletions

View file

@ -34,6 +34,23 @@ struct Curl_easy;
struct connectdata;
struct Curl_sockaddr_ex;
#ifndef SIZEOF_CURL_SOCKET_T
/* configure and cmake check and set the define */
# ifdef _WIN64
# define SIZEOF_CURL_SOCKET_T 8
# else
/* default guess */
# define SIZEOF_CURL_SOCKET_T 4
# endif
#endif
#if SIZEOF_CURL_SOCKET_T < 8
# define CURL_FORMAT_SOCKET_T "d"
#else
# define CURL_FORMAT_SOCKET_T "qd"
#endif
/*
* The Curl_sockaddr_ex structure is basically libcurl's external API
* curl_sockaddr structure with enough space available to directly hold any