curl_setup: use SIZE_MAX instead of SIZE_T_MAX

As SIZE_MAX exists in C99

Assisted-by: Stefan Eissing
Assisted-by: Jay Satiro

Ref: #18406
Closes #18426
This commit is contained in:
Daniel Stenberg 2025-08-29 09:24:39 +02:00
parent 7ceb9c54aa
commit 93f333c18f
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
13 changed files with 24 additions and 24 deletions

View file

@ -62,7 +62,7 @@ int curlx_dyn_vprintf(struct dynbuf *dyn, const char *format, va_list ap_save);
char *curlx_dyn_take(struct dynbuf *s, size_t *plen);
/* Dynamic buffer max sizes */
#define MAX_DYNBUF_SIZE (SIZE_T_MAX/2)
#define MAX_DYNBUF_SIZE (SIZE_MAX/2)
#define DYN_DOH_RESPONSE 3000
#define DYN_DOH_CNAME 256

View file

@ -165,7 +165,7 @@ static int str_num_base(const char **linep, curl_off_t *nump, curl_off_t max,
(base == 16) ? 'f' : '7';
DEBUGASSERT(linep && *linep && nump);
DEBUGASSERT((base == 8) || (base == 10) || (base == 16));
DEBUGASSERT(max >= 0); /* mostly to catch SIZE_T_MAX, which is too large */
DEBUGASSERT(max >= 0); /* mostly to catch SIZE_MAX, which is too large */
*nump = 0;
p = *linep;
if(!valid_digit(*p, m))

View file

@ -98,7 +98,7 @@ unsigned long curlx_uztoul(size_t uznum)
# pragma warning(disable:810) /* conversion may lose significant bits */
#endif
#if ULONG_MAX < SIZE_T_MAX
#if ULONG_MAX < SIZE_MAX
DEBUGASSERT(uznum <= (size_t) CURL_MASK_ULONG);
#endif
return (unsigned long)(uznum & (size_t) CURL_MASK_ULONG);
@ -119,7 +119,7 @@ unsigned int curlx_uztoui(size_t uznum)
# pragma warning(disable:810) /* conversion may lose significant bits */
#endif
#if UINT_MAX < SIZE_T_MAX
#if UINT_MAX < SIZE_MAX
DEBUGASSERT(uznum <= (size_t) CURL_MASK_UINT);
#endif
return (unsigned int)(uznum & (size_t) CURL_MASK_UINT);
@ -243,7 +243,7 @@ int curlx_sztosi(ssize_t sznum)
#endif
DEBUGASSERT(sznum >= 0);
#if INT_MAX < SSIZE_T_MAX
#if INT_MAX < SSIZE_MAX
DEBUGASSERT((size_t) sznum <= (size_t) CURL_MASK_SINT);
#endif
return (int)(sznum & (ssize_t) CURL_MASK_SINT);