tidy-up: miscellaneous

- apply more clang-format.
- lib/version: use `CURL_ARRAYSIZE()`.
- INSTALL-CMAKE.md: sync-up an option description with others.
- examples: delete unused main args.
- examples/ftpgetinfo: document `_CRT_SECURE_NO_WARNINGS` symbol.
- delete remaining stray duplicate lines.
- acinclude.m4: drop an unnecessary x-hack.
- vtls/mbedtls: join a URL split into two lines.
- src/tool_cb_see: add parentheses around macro expressions.
- src/tool_operate: move literals to the right side of comparisons.
- libtests: sync up fopen/fstat error messages between tests.
- curl_setup.h: replace `if ! defined __LP64` with `ifndef __LP64`.
  I assume it makes no difference on Tandem systems, as the latter form
  is already used in `include/curl/system.h`.

Closes #20018
This commit is contained in:
Viktor Szakats 2025-12-12 20:51:52 +01:00
parent cd9da30e76
commit 308c347c8b
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
53 changed files with 988 additions and 1005 deletions

View file

@ -1168,7 +1168,7 @@ AS_HELP_STRING([--without-ca-path], [Do not use a default CA path]),
dnl --with-ca-path given dnl --with-ca-path given
capath="$want_capath" capath="$want_capath"
ca="no" ca="no"
elif test "x$ca_native" != "xno"; then elif test "$ca_native" != "no"; then
# native ca configured, do not look further # native ca configured, do not look further
ca="no" ca="no"
capath="no" capath="no"

View file

@ -389,7 +389,7 @@ Details via CMake
- `OPENSSL_USE_STATIC_LIBS`: Look for static OpenSSL libraries. - `OPENSSL_USE_STATIC_LIBS`: Look for static OpenSSL libraries.
- `ZLIB_INCLUDE_DIR`: Absolute path to zlib include directory. - `ZLIB_INCLUDE_DIR`: Absolute path to zlib include directory.
- `ZLIB_LIBRARY`: Absolute path to `zlib` library. - `ZLIB_LIBRARY`: Absolute path to `zlib` library.
- `ZLIB_USE_STATIC_LIBS`: Look for static ZLIB library (requires CMake v3.24). - `ZLIB_USE_STATIC_LIBS`: Look for static `zlib` library (requires CMake v3.24).
## Dependency options (tools) ## Dependency options (tools)

View file

@ -451,15 +451,13 @@ void sigint_handler(int signo)
g_should_exit_ = 1; g_should_exit_ = 1;
} }
int main(int argc, char **argv) int main(void)
{ {
CURLcode result; CURLcode result;
struct GlobalInfo g; struct GlobalInfo g;
struct itimerspec its; struct itimerspec its;
struct epoll_event ev; struct epoll_event ev;
struct epoll_event events[10]; struct epoll_event events[10];
(void)argc;
(void)argv;
result = curl_global_init(CURL_GLOBAL_ALL); result = curl_global_init(CURL_GLOBAL_ALL);
if(result) if(result)

View file

@ -410,12 +410,10 @@ static int init_fifo(struct GlobalInfo *g)
return 0; return 0;
} }
int main(int argc, char **argv) int main(void)
{ {
CURLcode result; CURLcode result;
struct GlobalInfo g; struct GlobalInfo g;
(void)argc;
(void)argv;
result = curl_global_init(CURL_GLOBAL_ALL); result = curl_global_init(CURL_GLOBAL_ALL);
if(result) if(result)

View file

@ -27,7 +27,7 @@
*/ */
#ifdef _MSC_VER #ifdef _MSC_VER
#ifndef _CRT_SECURE_NO_WARNINGS #ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS /* for fopen() */ #define _CRT_SECURE_NO_WARNINGS /* for ctime(), fopen() */
#endif #endif
#endif #endif

View file

@ -419,12 +419,10 @@ static void clean_fifo(struct GlobalInfo *g)
unlink(fifo); unlink(fifo);
} }
int main(int argc, char **argv) int main(void)
{ {
CURLcode result; CURLcode result;
struct GlobalInfo g; struct GlobalInfo g;
(void)argc;
(void)argv;
result = curl_global_init(CURL_GLOBAL_ALL); result = curl_global_init(CURL_GLOBAL_ALL);
if(result) if(result)

View file

@ -69,7 +69,6 @@
} \ } \
} while(0) } while(0)
/* A list of connections to the same destination. */ /* A list of connections to the same destination. */
struct cpool_bundle { struct cpool_bundle {
struct Curl_llist conns; /* connections in the bundle */ struct Curl_llist conns; /* connections in the bundle */
@ -167,7 +166,6 @@ static struct cpool_bundle *cpool_find_bundle(struct cpool *cpool,
conn->destination, strlen(conn->destination) + 1); conn->destination, strlen(conn->destination) + 1);
} }
static void cpool_remove_bundle(struct cpool *cpool, static void cpool_remove_bundle(struct cpool *cpool,
struct cpool_bundle *bundle) struct cpool_bundle *bundle)
{ {

View file

@ -287,8 +287,10 @@ static const struct Curl_cwtype deflate_encoding = {
sizeof(struct zlib_writer) sizeof(struct zlib_writer)
}; };
/*
* Gzip handler.
*/
/* Gzip handler. */
static CURLcode gzip_do_init(struct Curl_easy *data, static CURLcode gzip_do_init(struct Curl_easy *data,
struct Curl_cwriter *writer) struct Curl_cwriter *writer)
{ {

View file

@ -162,7 +162,7 @@
/* ================================================================ */ /* ================================================================ */
/* Definition of preprocessor macros/symbols which modify compiler */ /* Definition of preprocessor macros/symbols which modify compiler */
/* behavior or generated code characteristics must be done here, */ /* behavior or generated code characteristics must be done here, */
/* as appropriate, before any system header file is included. It is */ /* as appropriate, before any system header file is included. It is */
/* also possible to have them defined in the config file included */ /* also possible to have them defined in the config file included */
/* before this point. As a result of all this we frown inclusion of */ /* before this point. As a result of all this we frown inclusion of */
@ -449,7 +449,7 @@
#include <assert.h> #include <assert.h>
#ifdef __TANDEM /* for ns*-tandem-nsk systems */ #ifdef __TANDEM /* for ns*-tandem-nsk systems */
# if ! defined __LP64 # ifndef __LP64
# include <floss.h> /* FLOSS is only used for 32-bit builds. */ # include <floss.h> /* FLOSS is only used for 32-bit builds. */
# endif # endif
#endif #endif
@ -783,7 +783,7 @@
* Definition of our NOP statement Object-like macro * Definition of our NOP statement Object-like macro
*/ */
#ifndef Curl_nop_stmt #ifndef Curl_nop_stmt
#define Curl_nop_stmt do { } while(0) #define Curl_nop_stmt do {} while(0)
#endif #endif
/* /*
@ -843,8 +843,8 @@
Therefore we specify it explicitly. https://github.com/curl/curl/pull/258 Therefore we specify it explicitly. https://github.com/curl/curl/pull/258
*/ */
#if defined(_WIN32) || defined(MSDOS) #if defined(_WIN32) || defined(MSDOS)
#define FOPEN_READTEXT "rt" #define FOPEN_READTEXT "rt"
#define FOPEN_WRITETEXT "wt" #define FOPEN_WRITETEXT "wt"
#define FOPEN_APPENDTEXT "at" #define FOPEN_APPENDTEXT "at"
#elif defined(__CYGWIN__) #elif defined(__CYGWIN__)
/* Cygwin has specific behavior we need to address when _WIN32 is not defined. /* Cygwin has specific behavior we need to address when _WIN32 is not defined.
@ -853,12 +853,12 @@ For write we want our output to have line endings of LF and be compatible with
other Cygwin utilities. For read we want to handle input that may have line other Cygwin utilities. For read we want to handle input that may have line
endings either CRLF or LF so 't' is appropriate. endings either CRLF or LF so 't' is appropriate.
*/ */
#define FOPEN_READTEXT "rt" #define FOPEN_READTEXT "rt"
#define FOPEN_WRITETEXT "w" #define FOPEN_WRITETEXT "w"
#define FOPEN_APPENDTEXT "a" #define FOPEN_APPENDTEXT "a"
#else #else
#define FOPEN_READTEXT "r" #define FOPEN_READTEXT "r"
#define FOPEN_WRITETEXT "w" #define FOPEN_WRITETEXT "w"
#define FOPEN_APPENDTEXT "a" #define FOPEN_APPENDTEXT "a"
#endif #endif
@ -919,7 +919,10 @@ extern curl_calloc_callback Curl_ccalloc;
* This macro also assigns NULL to given pointer when free'd. * This macro also assigns NULL to given pointer when free'd.
*/ */
#define Curl_safefree(ptr) \ #define Curl_safefree(ptr) \
do { curlx_free(ptr); (ptr) = NULL;} while(0) do { \
curlx_free(ptr); \
(ptr) = NULL; \
} while(0)
#include <curl/curl.h> /* for CURL_EXTERN, mprintf.h */ #include <curl/curl.h> /* for CURL_EXTERN, mprintf.h */
@ -1002,15 +1005,13 @@ CURL_EXTERN RECV_TYPE_RETV curl_dbg_recv(RECV_TYPE_ARG1 sockfd,
/* FILE functions */ /* FILE functions */
CURL_EXTERN int curl_dbg_fclose(FILE *file, int line, const char *source); CURL_EXTERN int curl_dbg_fclose(FILE *file, int line, const char *source);
CURL_EXTERN ALLOC_FUNC CURL_EXTERN ALLOC_FUNC FILE *curl_dbg_fopen(const char *file, const char *mode,
FILE *curl_dbg_fopen(const char *file, const char *mode, int line, const char *source);
int line, const char *source); CURL_EXTERN ALLOC_FUNC FILE *curl_dbg_freopen(const char *file,
CURL_EXTERN ALLOC_FUNC const char *mode, FILE *fh,
FILE *curl_dbg_freopen(const char *file, const char *mode, FILE *fh, int line, const char *source);
int line, const char *source); CURL_EXTERN ALLOC_FUNC FILE *curl_dbg_fdopen(int filedes, const char *mode,
CURL_EXTERN ALLOC_FUNC int line, const char *source);
FILE *curl_dbg_fdopen(int filedes, const char *mode,
int line, const char *source);
#define sclose(sockfd) curl_dbg_sclose(sockfd, __LINE__, __FILE__) #define sclose(sockfd) curl_dbg_sclose(sockfd, __LINE__, __FILE__)
#define fake_sclose(sockfd) curl_dbg_mark_sclose(sockfd, __LINE__, __FILE__) #define fake_sclose(sockfd) curl_dbg_mark_sclose(sockfd, __LINE__, __FILE__)
@ -1059,47 +1060,47 @@ CURL_EXTERN ALLOC_FUNC
#ifdef CURLDEBUG #ifdef CURLDEBUG
#define curlx_strdup(ptr) curl_dbg_strdup(ptr, __LINE__, __FILE__) #define curlx_strdup(ptr) curl_dbg_strdup(ptr, __LINE__, __FILE__)
#define curlx_malloc(size) curl_dbg_malloc(size, __LINE__, __FILE__) #define curlx_malloc(size) curl_dbg_malloc(size, __LINE__, __FILE__)
#define curlx_calloc(nbelem,size) \ #define curlx_calloc(nbelem, size) \
curl_dbg_calloc(nbelem, size, __LINE__, __FILE__) curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
#define curlx_realloc(ptr,size) \ #define curlx_realloc(ptr, size) \
curl_dbg_realloc(ptr, size, __LINE__, __FILE__) curl_dbg_realloc(ptr, size, __LINE__, __FILE__)
#define curlx_free(ptr) curl_dbg_free(ptr, __LINE__, __FILE__) #define curlx_free(ptr) curl_dbg_free(ptr, __LINE__, __FILE__)
#ifdef _WIN32 #ifdef _WIN32
#ifdef UNICODE #ifdef UNICODE
#define curlx_tcsdup(ptr) curl_dbg_wcsdup(ptr, __LINE__, __FILE__) #define curlx_tcsdup(ptr) curl_dbg_wcsdup(ptr, __LINE__, __FILE__)
#else #else
#define curlx_tcsdup(ptr) curlx_strdup(ptr) #define curlx_tcsdup(ptr) curlx_strdup(ptr)
#endif #endif
#endif /* _WIN32 */ #endif /* _WIN32 */
#else /* !CURLDEBUG */ #else /* !CURLDEBUG */
#ifdef BUILDING_LIBCURL #ifdef BUILDING_LIBCURL
#define curlx_strdup(ptr) Curl_cstrdup(ptr) #define curlx_strdup(ptr) Curl_cstrdup(ptr)
#define curlx_malloc(size) Curl_cmalloc(size) #define curlx_malloc(size) Curl_cmalloc(size)
#define curlx_calloc(nbelem,size) Curl_ccalloc(nbelem, size) #define curlx_calloc(nbelem, size) Curl_ccalloc(nbelem, size)
#define curlx_realloc(ptr,size) Curl_crealloc(ptr, size) #define curlx_realloc(ptr, size) Curl_crealloc(ptr, size)
#define curlx_free(ptr) Curl_cfree(ptr) #define curlx_free(ptr) Curl_cfree(ptr)
#else /* !BUILDING_LIBCURL */ #else /* !BUILDING_LIBCURL */
#ifdef _WIN32 #ifdef _WIN32
#define curlx_strdup(ptr) _strdup(ptr) #define curlx_strdup(ptr) _strdup(ptr)
#else #else
#define curlx_strdup(ptr) strdup(ptr) #define curlx_strdup(ptr) strdup(ptr)
#endif #endif
#define curlx_malloc(size) malloc(size) #define curlx_malloc(size) malloc(size)
#define curlx_calloc(nbelem,size) calloc(nbelem, size) #define curlx_calloc(nbelem, size) calloc(nbelem, size)
#define curlx_realloc(ptr,size) realloc(ptr, size) #define curlx_realloc(ptr, size) realloc(ptr, size)
#define curlx_free(ptr) free(ptr) #define curlx_free(ptr) free(ptr)
#endif /* BUILDING_LIBCURL */ #endif /* BUILDING_LIBCURL */
#ifdef _WIN32 #ifdef _WIN32
#ifdef UNICODE #ifdef UNICODE
#define curlx_tcsdup(ptr) Curl_wcsdup(ptr) #define curlx_tcsdup(ptr) Curl_wcsdup(ptr)
#else #else
#define curlx_tcsdup(ptr) curlx_strdup(ptr) #define curlx_tcsdup(ptr) curlx_strdup(ptr)
#endif #endif
#endif /* _WIN32 */ #endif /* _WIN32 */
@ -1124,8 +1125,8 @@ int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf,
#endif #endif
#if (defined(USE_NGTCP2) && defined(USE_NGHTTP3)) || \ #if (defined(USE_NGTCP2) && defined(USE_NGHTTP3)) || \
(defined(USE_OPENSSL_QUIC) && defined(USE_NGHTTP3)) || \ (defined(USE_OPENSSL_QUIC) && defined(USE_NGHTTP3)) || \
defined(USE_QUICHE) defined(USE_QUICHE)
#ifdef CURL_WITH_MULTI_SSL #ifdef CURL_WITH_MULTI_SSL
#error "MultiSSL combined with QUIC is not supported" #error "MultiSSL combined with QUIC is not supported"

View file

@ -263,7 +263,7 @@ typedef unsigned int bit;
#ifdef DEBUGBUILD #ifdef DEBUGBUILD
#define DEBUGF(x) x #define DEBUGF(x) x
#else #else
#define DEBUGF(x) do { } while(0) #define DEBUGF(x) do {} while(0)
#endif #endif
/* /*
@ -273,7 +273,7 @@ typedef unsigned int bit;
#ifdef DEBUGBUILD #ifdef DEBUGBUILD
#define DEBUGASSERT(x) assert(x) #define DEBUGASSERT(x) assert(x)
#else #else
#define DEBUGASSERT(x) do { } while(0) #define DEBUGASSERT(x) do {} while(0)
#endif #endif
/* /*

View file

@ -643,7 +643,6 @@ static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev)
} }
} }
if(!ev->msbump && ev->ms >= 0) { if(!ev->msbump && ev->ms >= 0) {
/* If nothing updated the timeout, we decrease it by the spent time. /* If nothing updated the timeout, we decrease it by the spent time.
* If it was updated, it has the new timeout time stored already. * If it was updated, it has the new timeout time stored already.

View file

@ -59,7 +59,7 @@
#endif #endif
#endif #endif
#endif #endif /* !__INTEL_COMPILER */
static CURL_INLINE void curl_simple_lock_lock(curl_simple_lock *lock) static CURL_INLINE void curl_simple_lock_lock(curl_simple_lock *lock)
{ {

View file

@ -3685,7 +3685,6 @@ static CURLcode ftp_do_more(struct Curl_easy *data, int *completep)
return result; return result;
} }
/*********************************************************************** /***********************************************************************
* *
* ftp_perform() * ftp_perform()

View file

@ -142,7 +142,6 @@ struct IMAP {
BIT(uidvalidity_set); BIT(uidvalidity_set);
}; };
/* Local API functions */ /* Local API functions */
static CURLcode imap_regular_transfer(struct Curl_easy *data, static CURLcode imap_regular_transfer(struct Curl_easy *data,
struct IMAP *imap, struct IMAP *imap,

View file

@ -262,7 +262,6 @@ static char *Curl_basename(char *path)
#define basename(x) Curl_basename(x) #define basename(x) Curl_basename(x)
#endif #endif
/* Set readback state. */ /* Set readback state. */
static void mimesetstate(struct mime_state *state, static void mimesetstate(struct mime_state *state,
enum mimestate tok, void *ptr) enum mimestate tok, void *ptr)
@ -272,7 +271,6 @@ static void mimesetstate(struct mime_state *state,
state->offset = 0; state->offset = 0;
} }
/* Escape header string into allocated memory. */ /* Escape header string into allocated memory. */
static char *escape_string(struct Curl_easy *data, static char *escape_string(struct Curl_easy *data,
const char *src, enum mimestrategy strategy) const char *src, enum mimestrategy strategy)

View file

@ -43,7 +43,6 @@
#include "bufref.h" #include "bufref.h"
#include "curlx/strparse.h" #include "curlx/strparse.h"
/* meta key for storing protocol meta at easy handle */ /* meta key for storing protocol meta at easy handle */
#define CURL_META_RTSP_EASY "meta:proto:rtsp:easy" #define CURL_META_RTSP_EASY "meta:proto:rtsp:easy"
/* meta key for storing protocol meta at connection */ /* meta key for storing protocol meta at connection */
@ -72,7 +71,6 @@ struct RTSP {
long CSeq_recv; /* CSeq received */ long CSeq_recv; /* CSeq received */
}; };
#define RTP_PKT_LENGTH(p) ((((unsigned int)((unsigned char)((p)[2]))) << 8) | \ #define RTP_PKT_LENGTH(p) ((((unsigned int)((unsigned char)((p)[2]))) << 8) | \
((unsigned int)((unsigned char)((p)[3])))) ((unsigned int)((unsigned char)((p)[3]))))

View file

@ -1703,7 +1703,6 @@ static CURLcode smtp_regular_transfer(struct Curl_easy *data,
return result; return result;
} }
static void smtp_easy_dtor(void *key, size_t klen, void *entry) static void smtp_easy_dtor(void *key, size_t klen, void *entry)
{ {
struct SMTP *smtp = entry; struct SMTP *smtp = entry;

View file

@ -94,7 +94,6 @@
#define CURL_EMPTY 0 #define CURL_EMPTY 0
#define CURL_OPPOSITE 1 #define CURL_OPPOSITE 1
/* meta key for storing protocol meta at easy handle */ /* meta key for storing protocol meta at easy handle */
#define CURL_META_TELNET_EASY "meta:proto:telnet:easy" #define CURL_META_TELNET_EASY "meta:proto:telnet:easy"

View file

@ -143,7 +143,6 @@ struct tftp_conn {
BIT(remote_pinned); BIT(remote_pinned);
}; };
/* Forward declarations */ /* Forward declarations */
static CURLcode tftp_rx(struct tftp_conn *state, tftp_event_t event); static CURLcode tftp_rx(struct tftp_conn *state, tftp_event_t event);
static CURLcode tftp_tx(struct tftp_conn *state, tftp_event_t event); static CURLcode tftp_tx(struct tftp_conn *state, tftp_event_t event);
@ -162,7 +161,6 @@ static CURLcode tftp_translate_code(tftp_error_t error);
/* /*
* TFTP protocol handler. * TFTP protocol handler.
*/ */
const struct Curl_handler Curl_handler_tftp = { const struct Curl_handler Curl_handler_tftp = {
"tftp", /* scheme */ "tftp", /* scheme */
tftp_setup_connection, /* setup_connection */ tftp_setup_connection, /* setup_connection */

View file

@ -741,14 +741,14 @@ struct connectdata {
#ifndef CURL_DISABLE_PROXY #ifndef CURL_DISABLE_PROXY
#define CURL_CONN_HOST_DISPNAME(c) \ #define CURL_CONN_HOST_DISPNAME(c) \
((c)->bits.socksproxy ? (c)->socks_proxy.host.dispname : \ ((c)->bits.socksproxy ? (c)->socks_proxy.host.dispname : \
(c)->bits.httpproxy ? (c)->http_proxy.host.dispname : \ (c)->bits.httpproxy ? (c)->http_proxy.host.dispname : \
(c)->bits.conn_to_host ? (c)->conn_to_host.dispname : \ (c)->bits.conn_to_host ? (c)->conn_to_host.dispname : \
(c)->host.dispname) (c)->host.dispname)
#else #else
#define CURL_CONN_HOST_DISPNAME(c) \ #define CURL_CONN_HOST_DISPNAME(c) \
(c)->bits.conn_to_host ? (c)->conn_to_host.dispname : \ (c)->bits.conn_to_host ? (c)->conn_to_host.dispname : \
(c)->host.dispname (c)->host.dispname
#endif #endif
/* The end of connectdata. */ /* The end of connectdata. */
@ -1162,7 +1162,7 @@ enum dupstring {
STRING_SSL_CIPHER_LIST, /* list of ciphers to use */ STRING_SSL_CIPHER_LIST, /* list of ciphers to use */
STRING_SSL_CIPHER13_LIST, /* list of TLS 1.3 ciphers to use */ STRING_SSL_CIPHER13_LIST, /* list of TLS 1.3 ciphers to use */
STRING_SSL_CRLFILE, /* CRL file to check certificate */ STRING_SSL_CRLFILE, /* CRL file to check certificate */
STRING_SSL_ISSUERCERT, /* issuer cert file to check certificate */ STRING_SSL_ISSUERCERT, /* issuer cert file to check certificate */
STRING_SERVICE_NAME, /* Service name */ STRING_SERVICE_NAME, /* Service name */
#ifndef CURL_DISABLE_PROXY #ifndef CURL_DISABLE_PROXY
STRING_CERT_PROXY, /* client certificate filename */ STRING_CERT_PROXY, /* client certificate filename */

View file

@ -551,9 +551,7 @@ static const struct feat features_table[] = {
{NULL, NULL, 0} {NULL, NULL, 0}
}; };
static const char *feature_names[sizeof(features_table) / static const char *feature_names[CURL_ARRAYSIZE(features_table)] = { NULL };
sizeof(features_table[0])] = {NULL};
static curl_version_info_data version_info = { static curl_version_info_data version_info = {
CURLVERSION_NOW, CURLVERSION_NOW,

View file

@ -54,7 +54,6 @@
#define NW_CHUNK_SIZE (64 * 1024) #define NW_CHUNK_SIZE (64 * 1024)
#define NW_SEND_CHUNKS 1 #define NW_SEND_CHUNKS 1
int Curl_vquic_init(void) int Curl_vquic_init(void)
{ {
#if defined(USE_NGTCP2) && defined(OPENSSL_QUIC_API2) #if defined(USE_NGTCP2) && defined(OPENSSL_QUIC_API2)

View file

@ -282,7 +282,6 @@ static const char *myssh_statename(sshstate state)
#define myssh_statename(x) "" #define myssh_statename(x) ""
#endif /* !CURL_DISABLE_VERBOSE_STRINGS */ #endif /* !CURL_DISABLE_VERBOSE_STRINGS */
#define myssh_to(x, y, z) myssh_set_state(x, y, z) #define myssh_to(x, y, z) myssh_set_state(x, y, z)
/* /*

View file

@ -123,7 +123,6 @@ const struct Curl_handler Curl_handler_scp = {
PROTOPT_NOURLQUERY | PROTOPT_CONN_REUSE PROTOPT_NOURLQUERY | PROTOPT_CONN_REUSE
}; };
/* /*
* SFTP protocol handler. * SFTP protocol handler.
*/ */
@ -353,7 +352,6 @@ static const char *myssh_statename(sshstate state)
#define myssh_statename(x) "" #define myssh_statename(x) ""
#endif /* !CURL_DISABLE_VERBOSE_STRINGS */ #endif /* !CURL_DISABLE_VERBOSE_STRINGS */
#define myssh_state(x, y, z) myssh_set_state(x, y, z) #define myssh_state(x, y, z) myssh_set_state(x, y, z)
/* /*

View file

@ -229,9 +229,9 @@ static const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_fr = {
1024, /* RSA min key len */ 1024, /* RSA min key len */
}; };
/* See https://web.archive.org/web/20200921194007/tls.mbed.org/discussions/ /* See:
generic/howto-determine-exact-buffer-len-for-mbedtls_pk_write_pubkey_der * https://web.archive.org/web/20200921194007/tls.mbed.org/discussions/generic/howto-determine-exact-buffer-len-for-mbedtls_pk_write_pubkey_der
*/ */
#define RSA_PUB_DER_MAX_BYTES (38 + 2 * MBEDTLS_MPI_MAX_SIZE) #define RSA_PUB_DER_MAX_BYTES (38 + 2 * MBEDTLS_MPI_MAX_SIZE)
#define ECP_PUB_DER_MAX_BYTES (30 + 2 * MBEDTLS_ECP_MAX_BYTES) #define ECP_PUB_DER_MAX_BYTES (30 + 2 * MBEDTLS_ECP_MAX_BYTES)

View file

@ -1443,7 +1443,6 @@ fail:
return 1; return 1;
} }
static CURLcode client_cert(struct Curl_easy *data, static CURLcode client_cert(struct Curl_easy *data,
SSL_CTX* ctx, SSL_CTX* ctx,
char *cert_file, char *cert_file,
@ -3629,7 +3628,6 @@ static CURLcode ossl_init_ssl(struct ossl_ctx *octx,
alpns_requested, sess_reuse_cb); alpns_requested, sess_reuse_cb);
} }
static CURLcode ossl_init_method(struct Curl_cfilter *cf, static CURLcode ossl_init_method(struct Curl_cfilter *cf,
struct Curl_easy *data, struct Curl_easy *data,
struct ssl_peer *peer, struct ssl_peer *peer,
@ -3828,7 +3826,7 @@ CURLcode Curl_ossl_ctx_init(struct ossl_ctx *octx,
OpenSSL supports processing "jumbo TLS record" (8 TLS records) in one go OpenSSL supports processing "jumbo TLS record" (8 TLS records) in one go
for some algorithms, so match that here. for some algorithms, so match that here.
Experimentation shows that a slightly larger buffer is needed Experimentation shows that a slightly larger buffer is needed
to avoid short reads. to avoid short reads.
However using a large buffer (8 packets) actually decreases performance. However using a large buffer (8 packets) actually decreases performance.
4 packets is better. 4 packets is better.
@ -4669,7 +4667,6 @@ out:
} }
#endif /* ! CURL_DISABLE_VERBOSE_STRINGS */ #endif /* ! CURL_DISABLE_VERBOSE_STRINGS */
#ifdef USE_APPLE_SECTRUST #ifdef USE_APPLE_SECTRUST
struct ossl_certs_ctx { struct ossl_certs_ctx {
STACK_OF(X509) *sk; STACK_OF(X509) *sk;

View file

@ -70,8 +70,8 @@
#define SCH_DEV_SHOWBOOL(x) \ #define SCH_DEV_SHOWBOOL(x) \
infof(data, "schannel: " #x " %s", (x) ? "TRUE" : "FALSE"); infof(data, "schannel: " #x " %s", (x) ? "TRUE" : "FALSE");
#else #else
#define SCH_DEV(x) do { } while(0) #define SCH_DEV(x) do {} while(0)
#define SCH_DEV_SHOWBOOL(x) do { } while(0) #define SCH_DEV_SHOWBOOL(x) do {} while(0)
#endif #endif
/* Offered by mingw-w64 v8+. MS SDK 7.0A+. */ /* Offered by mingw-w64 v8+. MS SDK 7.0A+. */

View file

@ -36,7 +36,6 @@
#include <wolfssl/options.h> #include <wolfssl/options.h>
#include <wolfssl/version.h> #include <wolfssl/version.h>
#if LIBWOLFSSL_VERSION_HEX < 0x03004006 /* wolfSSL 3.4.6 (2015) */ #if LIBWOLFSSL_VERSION_HEX < 0x03004006 /* wolfSSL 3.4.6 (2015) */
#error "wolfSSL version should be at least 3.4.6" #error "wolfSSL version should be at least 3.4.6"
#endif #endif

View file

@ -92,7 +92,6 @@
/* #define CURL_ASN1_CHARACTER_STRING 29 */ /* #define CURL_ASN1_CHARACTER_STRING 29 */
#define CURL_ASN1_BMP_STRING 30 #define CURL_ASN1_BMP_STRING 30
#ifdef WANT_EXTRACT_CERTINFO #ifdef WANT_EXTRACT_CERTINFO
/* ASN.1 OID table entry. */ /* ASN.1 OID table entry. */
struct Curl_OID { struct Curl_OID {

View file

@ -43,7 +43,6 @@
#include "curlx/strparse.h" #include "curlx/strparse.h"
#include "curlx/warnless.h" #include "curlx/warnless.h"
/*** /***
RFC 6455 Section 5.2 RFC 6455 Section 5.2
@ -770,7 +769,6 @@ static const struct Curl_cwtype ws_cw_decode = {
sizeof(struct ws_cw_ctx) sizeof(struct ws_cw_ctx)
}; };
static void ws_enc_info(struct ws_encoder *enc, struct Curl_easy *data, static void ws_enc_info(struct ws_encoder *enc, struct Curl_easy *data,
const char *msg) const char *msg)
{ {

View file

@ -184,6 +184,7 @@ AC_DEFUN([CURL_CHECK_NEED_REENTRANT_STRERROR_R], [
fi fi
]) ])
dnl CURL_CHECK_NEED_REENTRANT_GETHOSTBYNAME_R dnl CURL_CHECK_NEED_REENTRANT_GETHOSTBYNAME_R
dnl ------------------------------------------------- dnl -------------------------------------------------
dnl Checks if the preprocessor _REENTRANT definition dnl Checks if the preprocessor _REENTRANT definition

View file

@ -1127,7 +1127,7 @@ HEAD
$bitmask .= ' | '; $bitmask .= ' | ';
} }
} }
$bitmask =~ s/(?=.{76}).{1,76}\|/$&\n /g; $bitmask =~ s/(?=.{76}).{1,76}\|/$&\n /g;
my $arg = $arglong{$long}; my $arg = $arglong{$long};
if($arg) { if($arg) {
$opt .= " $arg"; $opt .= " $arg";
@ -1135,7 +1135,7 @@ HEAD
my $desc = $helplong{$f}; my $desc = $helplong{$f};
$desc =~ s/\"/\\\"/g; # escape double quotes $desc =~ s/\"/\\\"/g; # escape double quotes
my $line = sprintf " {\"%s\",\n \"%s\",\n %s},\n", $opt, $desc, $bitmask; my $line = sprintf " { \"%s\",\n \"%s\",\n %s },\n", $opt, $desc, $bitmask;
if(length($opt) > 78) { if(length($opt) > 78) {
print STDERR "WARN: the --$long name is too long\n"; print STDERR "WARN: the --$long name is too long\n";

View file

@ -229,8 +229,7 @@ int tool_progress_cb(void *clientp,
return 0; return 0;
} }
void progressbarinit(struct ProgressData *bar, void progressbarinit(struct ProgressData *bar, struct OperationConfig *config)
struct OperationConfig *config)
{ {
memset(bar, 0, sizeof(struct ProgressData)); memset(bar, 0, sizeof(struct ProgressData));

View file

@ -42,8 +42,7 @@ struct ProgressData {
struct OperationConfig; struct OperationConfig;
void progressbarinit(struct ProgressData *bar, void progressbarinit(struct ProgressData *bar, struct OperationConfig *config);
struct OperationConfig *config);
/* /*
** callback for CURLOPT_PROGRESSFUNCTION ** callback for CURLOPT_PROGRESSFUNCTION

View file

@ -44,8 +44,8 @@ int tool_seek_cb(void *userdata, curl_off_t offset, int whence)
both represent the same value. Maximum offset used here when we lseek both represent the same value. Maximum offset used here when we lseek
using a 'long' data type offset */ using a 'long' data type offset */
#define OUR_MAX_SEEK_L 2147483647L - 1L #define OUR_MAX_SEEK_L (2147483647L - 1L)
#define OUR_MAX_SEEK_O 0x7FFFFFFF - 0x1 #define OUR_MAX_SEEK_O (0x7FFFFFFF - 0x1)
/* The offset check following here is only interesting if curl_off_t is /* The offset check following here is only interesting if curl_off_t is
larger than off_t and we are not using the Win32 large file support larger than off_t and we are not using the Win32 large file support

View file

@ -38,7 +38,7 @@
#endif #endif
#endif #endif
#define MAX_CONFIG_LINE_LENGTH (10*1024*1024) #define MAX_CONFIG_LINE_LENGTH (10 * 1024 * 1024)
#define checkprefix(a, b) curl_strnequal(b, STRCONST(a)) #define checkprefix(a, b) curl_strnequal(b, STRCONST(a))

View file

@ -44,8 +44,7 @@ int getfiletime(const char *filename, curl_off_t *stamp)
TCHAR *tchar_filename = curlx_convert_UTF8_to_tchar(filename); TCHAR *tchar_filename = curlx_convert_UTF8_to_tchar(filename);
hfile = CreateFile(tchar_filename, FILE_READ_ATTRIBUTES, hfile = CreateFile(tchar_filename, FILE_READ_ATTRIBUTES,
(FILE_SHARE_READ | FILE_SHARE_WRITE | (FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE),
FILE_SHARE_DELETE),
NULL, OPEN_EXISTING, 0, NULL); NULL, OPEN_EXISTING, 0, NULL);
curlx_free(tchar_filename); curlx_free(tchar_filename);
if(hfile != INVALID_HANDLE_VALUE) { if(hfile != INVALID_HANDLE_VALUE) {
@ -110,8 +109,7 @@ void setfiletime(curl_off_t filetime, const char *filename)
} }
hfile = CreateFile(tchar_filename, FILE_WRITE_ATTRIBUTES, hfile = CreateFile(tchar_filename, FILE_WRITE_ATTRIBUTES,
(FILE_SHARE_READ | FILE_SHARE_WRITE | (FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE),
FILE_SHARE_DELETE),
NULL, OPEN_EXISTING, 0, NULL); NULL, OPEN_EXISTING, 0, NULL);
curlx_free(tchar_filename); curlx_free(tchar_filename);
if(hfile != INVALID_HANDLE_VALUE) { if(hfile != INVALID_HANDLE_VALUE) {

View file

@ -840,9 +840,9 @@ int formparse(const char *input,
part->headers = headers; part->headers = headers;
headers = NULL; headers = NULL;
if(res == CURLE_READ_ERROR) { if(res == CURLE_READ_ERROR) {
/* An error occurred while reading stdin: if read has started, /* An error occurred while reading stdin: if read has started,
issue the error now. Else, delay it until processed by issue the error now. Else, delay it until processed by
libcurl. */ libcurl. */
if(part->size > 0) { if(part->size > 0) {
warnf("error while reading standard input"); warnf("error while reading standard input");
goto fail; goto fail;

View file

@ -61,7 +61,7 @@ static struct proto_name_tokenp {
{ "scp", &proto_scp }, { "scp", &proto_scp },
{ "sftp", &proto_sftp }, { "sftp", &proto_sftp },
{ "tftp", &proto_tftp }, { "tftp", &proto_tftp },
{ NULL, NULL } { NULL, NULL }
}; };
bool feature_altsvc = FALSE; bool feature_altsvc = FALSE;
@ -87,38 +87,38 @@ static struct feature_name_presentp {
int feature_bitmask; int feature_bitmask;
} const maybe_feature[] = { } const maybe_feature[] = {
/* Keep alphabetically sorted. */ /* Keep alphabetically sorted. */
{"alt-svc", &feature_altsvc, CURL_VERSION_ALTSVC}, { "alt-svc", &feature_altsvc, CURL_VERSION_ALTSVC },
{"AsynchDNS", NULL, CURL_VERSION_ASYNCHDNS}, { "AsynchDNS", NULL, CURL_VERSION_ASYNCHDNS },
{"brotli", &feature_brotli, CURL_VERSION_BROTLI}, { "brotli", &feature_brotli, CURL_VERSION_BROTLI },
{"CharConv", NULL, CURL_VERSION_CONV}, { "CharConv", NULL, CURL_VERSION_CONV },
{"Debug", NULL, CURL_VERSION_DEBUG}, { "Debug", NULL, CURL_VERSION_DEBUG },
{"ECH", &feature_ech, 0}, { "ECH", &feature_ech, 0 },
{"gsasl", NULL, CURL_VERSION_GSASL}, { "gsasl", NULL, CURL_VERSION_GSASL },
{"GSS-API", NULL, CURL_VERSION_GSSAPI}, { "GSS-API", NULL, CURL_VERSION_GSSAPI },
{"HSTS", &feature_hsts, CURL_VERSION_HSTS}, { "HSTS", &feature_hsts, CURL_VERSION_HSTS },
{"HTTP2", &feature_http2, CURL_VERSION_HTTP2}, { "HTTP2", &feature_http2, CURL_VERSION_HTTP2 },
{"HTTP3", &feature_http3, CURL_VERSION_HTTP3}, { "HTTP3", &feature_http3, CURL_VERSION_HTTP3 },
{"HTTPS-proxy", &feature_httpsproxy, CURL_VERSION_HTTPS_PROXY}, { "HTTPS-proxy", &feature_httpsproxy, CURL_VERSION_HTTPS_PROXY },
{"IDN", NULL, CURL_VERSION_IDN}, { "IDN", NULL, CURL_VERSION_IDN },
{"IPv6", NULL, CURL_VERSION_IPV6}, { "IPv6", NULL, CURL_VERSION_IPV6 },
{"Kerberos", NULL, CURL_VERSION_KERBEROS5}, { "Kerberos", NULL, CURL_VERSION_KERBEROS5 },
{"Largefile", NULL, CURL_VERSION_LARGEFILE}, { "Largefile", NULL, CURL_VERSION_LARGEFILE },
{"libz", &feature_libz, CURL_VERSION_LIBZ}, { "libz", &feature_libz, CURL_VERSION_LIBZ },
{"MultiSSL", NULL, CURL_VERSION_MULTI_SSL}, { "MultiSSL", NULL, CURL_VERSION_MULTI_SSL },
{"NTLM", &feature_ntlm, CURL_VERSION_NTLM}, { "NTLM", &feature_ntlm, CURL_VERSION_NTLM },
{"NTLM_WB", &feature_ntlm_wb, CURL_VERSION_NTLM_WB}, { "NTLM_WB", &feature_ntlm_wb, CURL_VERSION_NTLM_WB },
{"PSL", NULL, CURL_VERSION_PSL}, { "PSL", NULL, CURL_VERSION_PSL },
{"SPNEGO", &feature_spnego, CURL_VERSION_SPNEGO}, { "SPNEGO", &feature_spnego, CURL_VERSION_SPNEGO },
{"SSL", &feature_ssl, CURL_VERSION_SSL}, { "SSL", &feature_ssl, CURL_VERSION_SSL },
{"SSPI", NULL, CURL_VERSION_SSPI}, { "SSPI", NULL, CURL_VERSION_SSPI },
{"SSLS-EXPORT", &feature_ssls_export, 0}, { "SSLS-EXPORT", &feature_ssls_export, 0 },
{"threadsafe", NULL, CURL_VERSION_THREADSAFE}, { "threadsafe", NULL, CURL_VERSION_THREADSAFE },
{"TLS-SRP", &feature_tls_srp, CURL_VERSION_TLSAUTH_SRP}, { "TLS-SRP", &feature_tls_srp, CURL_VERSION_TLSAUTH_SRP },
{"TrackMemory", NULL, CURL_VERSION_CURLDEBUG}, { "TrackMemory", NULL, CURL_VERSION_CURLDEBUG },
{"Unicode", NULL, CURL_VERSION_UNICODE}, { "Unicode", NULL, CURL_VERSION_UNICODE },
{"UnixSockets", NULL, CURL_VERSION_UNIX_SOCKETS}, { "UnixSockets", NULL, CURL_VERSION_UNIX_SOCKETS },
{"zstd", &feature_zstd, CURL_VERSION_ZSTD}, { "zstd", &feature_zstd, CURL_VERSION_ZSTD },
{NULL, NULL, 0} { NULL, NULL, 0 }
}; };
static const char *fnames[CURL_ARRAYSIZE(maybe_feature)]; static const char *fnames[CURL_ARRAYSIZE(maybe_feature)];
@ -186,7 +186,7 @@ CURLcode get_libcurl_info(void)
} }
feature_libssh2 = curlinfo->libssh_version && feature_libssh2 = curlinfo->libssh_version &&
!strncmp("libssh2", curlinfo->libssh_version, 7); !strncmp("libssh2", curlinfo->libssh_version, 7);
return CURLE_OK; return CURLE_OK;
} }

File diff suppressed because it is too large Load diff

View file

@ -32,13 +32,10 @@
#define NOTE_PREFIX "Note: " #define NOTE_PREFIX "Note: "
#define ERROR_PREFIX "curl: " #define ERROR_PREFIX "curl: "
static void voutf(const char *prefix, static void voutf(const char *prefix, const char *fmt, va_list ap)
const char *fmt, CURL_PRINTF(2, 0);
va_list ap) CURL_PRINTF(2, 0);
static void voutf(const char *prefix, static void voutf(const char *prefix, const char *fmt, va_list ap)
const char *fmt,
va_list ap)
{ {
size_t len; size_t len;
char *ptr; char *ptr;

View file

@ -377,21 +377,21 @@ static CURLcode retrycheck(struct OperationConfig *config,
RETRY_FTP, RETRY_FTP,
RETRY_LAST /* not used */ RETRY_LAST /* not used */
} retry = RETRY_NO; } retry = RETRY_NO;
if((CURLE_OPERATION_TIMEDOUT == result) || if((result == CURLE_OPERATION_TIMEDOUT) ||
(CURLE_COULDNT_RESOLVE_HOST == result) || (result == CURLE_COULDNT_RESOLVE_HOST) ||
(CURLE_COULDNT_RESOLVE_PROXY == result) || (result == CURLE_COULDNT_RESOLVE_PROXY) ||
(CURLE_FTP_ACCEPT_TIMEOUT == result)) (result == CURLE_FTP_ACCEPT_TIMEOUT))
/* retry timeout always */ /* retry timeout always */
retry = RETRY_TIMEOUT; retry = RETRY_TIMEOUT;
else if(config->retry_connrefused && else if(config->retry_connrefused &&
(CURLE_COULDNT_CONNECT == result)) { (result == CURLE_COULDNT_CONNECT)) {
long oserrno = 0; long oserrno = 0;
curl_easy_getinfo(curl, CURLINFO_OS_ERRNO, &oserrno); curl_easy_getinfo(curl, CURLINFO_OS_ERRNO, &oserrno);
if(SOCKECONNREFUSED == oserrno) if(SOCKECONNREFUSED == oserrno)
retry = RETRY_CONNREFUSED; retry = RETRY_CONNREFUSED;
} }
else if((CURLE_OK == result) || else if((result == CURLE_OK) ||
(config->fail && (CURLE_HTTP_RETURNED_ERROR == result))) { (config->fail && (result == CURLE_HTTP_RETURNED_ERROR))) {
/* If it returned OK. _or_ failonerror was enabled and it /* If it returned OK. _or_ failonerror was enabled and it
returned due to such an error, check for HTTP transient returned due to such an error, check for HTTP transient
errors to retry on. */ errors to retry on. */

View file

@ -306,10 +306,18 @@ ParameterError secs2ms(long *valp, const char *str)
{ {
curl_off_t secs; curl_off_t secs;
long ms = 0; long ms = 0;
const unsigned int digs[] = { 1, 10, 100, 1000, 10000, 100000, const unsigned int digs[] = {
1000000, 10000000, 100000000 }; 1,
if(!str || 10,
curlx_str_number(&str, &secs, LONG_MAX / 1000 - 1)) 100,
1000,
10000,
100000,
1000000,
10000000,
100000000
};
if(!str || curlx_str_number(&str, &secs, LONG_MAX / 1000 - 1))
return PARAM_BAD_NUMERIC; return PARAM_BAD_NUMERIC;
if(!curlx_str_single(&str, '.')) { if(!curlx_str_single(&str, '.')) {
curl_off_t fracs; curl_off_t fracs;

View file

@ -73,7 +73,7 @@ extern FILE *tool_stderr;
#endif #endif
#ifndef tool_nop_stmt #ifndef tool_nop_stmt
#define tool_nop_stmt do { } while(0) #define tool_nop_stmt do {} while(0)
#endif #endif
#ifdef _WIN32 #ifdef _WIN32

View file

@ -34,8 +34,7 @@
Return 0 on success, non-zero on error. Return 0 on success, non-zero on error.
*/ */
int jsonquoted(const char *in, size_t len, int jsonquoted(const char *in, size_t len, struct dynbuf *out, bool lowercase)
struct dynbuf *out, bool lowercase)
{ {
const unsigned char *i = (const unsigned char *)in; const unsigned char *i = (const unsigned char *)in;
const unsigned char *in_end = &i[len]; const unsigned char *in_end = &i[len];

View file

@ -26,8 +26,7 @@
#include "tool_setup.h" #include "tool_setup.h"
#include "tool_writeout.h" #include "tool_writeout.h"
int jsonquoted(const char *in, size_t len, int jsonquoted(const char *in, size_t len, struct dynbuf *out, bool lowercase);
struct dynbuf *out, bool lowercase);
void ourWriteOutJSON(FILE *stream, const struct writeoutvar mappings[], void ourWriteOutJSON(FILE *stream, const struct writeoutvar mappings[],
size_t nentries, size_t nentries,

View file

@ -52,7 +52,7 @@ static CURLcode test_lib505(const char *URL)
hd_src = curlx_fopen(libtest_arg2, "rb"); hd_src = curlx_fopen(libtest_arg2, "rb");
if(!hd_src) { if(!hd_src) {
curl_mfprintf(stderr, "fopen failed with error (%d) %s\n", curl_mfprintf(stderr, "fopen() failed with error (%d) %s\n",
errno, curlx_strerror(errno, errbuf, sizeof(errbuf))); errno, curlx_strerror(errno, errbuf, sizeof(errbuf)));
curl_mfprintf(stderr, "Error opening file '%s'\n", libtest_arg2); curl_mfprintf(stderr, "Error opening file '%s'\n", libtest_arg2);
return TEST_ERR_MAJOR_BAD; /* if this happens things are major weird */ return TEST_ERR_MAJOR_BAD; /* if this happens things are major weird */

View file

@ -43,7 +43,7 @@ static CURLcode test_lib525(const char *URL)
hd_src = curlx_fopen(libtest_arg2, "rb"); hd_src = curlx_fopen(libtest_arg2, "rb");
if(!hd_src) { if(!hd_src) {
curl_mfprintf(stderr, "fopen failed with error (%d) %s\n", curl_mfprintf(stderr, "fopen() failed with error (%d) %s\n",
errno, curlx_strerror(errno, errbuf, sizeof(errbuf))); errno, curlx_strerror(errno, errbuf, sizeof(errbuf)));
curl_mfprintf(stderr, "Error opening file '%s'\n", libtest_arg2); curl_mfprintf(stderr, "Error opening file '%s'\n", libtest_arg2);
return TEST_ERR_FOPEN; return TEST_ERR_FOPEN;

View file

@ -43,7 +43,7 @@ static CURLcode test_lib541(const char *URL)
hd_src = curlx_fopen(libtest_arg2, "rb"); hd_src = curlx_fopen(libtest_arg2, "rb");
if(!hd_src) { if(!hd_src) {
curl_mfprintf(stderr, "fopen failed with error (%d) %s\n", curl_mfprintf(stderr, "fopen() failed with error (%d) %s\n",
errno, curlx_strerror(errno, errbuf, sizeof(errbuf))); errno, curlx_strerror(errno, errbuf, sizeof(errbuf)));
curl_mfprintf(stderr, "Error opening file '%s'\n", libtest_arg2); curl_mfprintf(stderr, "Error opening file '%s'\n", libtest_arg2);
return TEST_ERR_MAJOR_BAD; /* if this happens things are major weird */ return TEST_ERR_MAJOR_BAD; /* if this happens things are major weird */

View file

@ -32,6 +32,7 @@ static CURLcode test_lib568(const char *URL)
{ {
CURLcode result; CURLcode result;
CURL *curl; CURL *curl;
char errbuf[STRERROR_LEN];
int sdp; int sdp;
FILE *sdpf = NULL; FILE *sdpf = NULL;
struct_stat file_info; struct_stat file_info;
@ -67,7 +68,9 @@ static CURLcode test_lib568(const char *URL)
sdp = curlx_open(libtest_arg2, O_RDONLY); sdp = curlx_open(libtest_arg2, O_RDONLY);
if(sdp == -1) { if(sdp == -1) {
curl_mfprintf(stderr, "cannot open %s\n", libtest_arg2); curl_mfprintf(stderr, "open() failed with error (%d) %s\n",
errno, curlx_strerror(errno, errbuf, sizeof(errbuf)));
curl_mfprintf(stderr, "Error opening file '%s'\n", libtest_arg2);
result = TEST_ERR_MAJOR_BAD; result = TEST_ERR_MAJOR_BAD;
goto test_cleanup; goto test_cleanup;
} }
@ -76,7 +79,9 @@ static CURLcode test_lib568(const char *URL)
sdpf = curlx_fopen(libtest_arg2, "rb"); sdpf = curlx_fopen(libtest_arg2, "rb");
if(!sdpf) { if(!sdpf) {
curl_mfprintf(stderr, "cannot fopen %s\n", libtest_arg2); curl_mfprintf(stderr, "fopen() failed with error (%d) %s\n",
errno, curlx_strerror(errno, errbuf, sizeof(errbuf)));
curl_mfprintf(stderr, "Error opening file '%s'\n", libtest_arg2);
result = TEST_ERR_MAJOR_BAD; result = TEST_ERR_MAJOR_BAD;
goto test_cleanup; goto test_cleanup;
} }

View file

@ -32,6 +32,7 @@ static CURLcode test_lib572(const char *URL)
{ {
CURLcode result; CURLcode result;
CURL *curl; CURL *curl;
char errbuf[STRERROR_LEN];
int params; int params;
FILE *paramsf = NULL; FILE *paramsf = NULL;
struct_stat file_info; struct_stat file_info;
@ -85,7 +86,9 @@ static CURLcode test_lib572(const char *URL)
/* PUT style GET_PARAMETERS */ /* PUT style GET_PARAMETERS */
params = curlx_open(libtest_arg2, O_RDONLY); params = curlx_open(libtest_arg2, O_RDONLY);
if(params == -1) { if(params == -1) {
curl_mfprintf(stderr, "cannot open %s\n", libtest_arg2); curl_mfprintf(stderr, "open() failed with error (%d) %s\n",
errno, curlx_strerror(errno, errbuf, sizeof(errbuf)));
curl_mfprintf(stderr, "Error opening file '%s'\n", libtest_arg2);
result = TEST_ERR_MAJOR_BAD; result = TEST_ERR_MAJOR_BAD;
goto test_cleanup; goto test_cleanup;
} }
@ -94,7 +97,9 @@ static CURLcode test_lib572(const char *URL)
paramsf = curlx_fopen(libtest_arg2, "rb"); paramsf = curlx_fopen(libtest_arg2, "rb");
if(!paramsf) { if(!paramsf) {
curl_mfprintf(stderr, "cannot fopen %s\n", libtest_arg2); curl_mfprintf(stderr, "fopen() failed with error (%d) %s\n",
errno, curlx_strerror(errno, errbuf, sizeof(errbuf)));
curl_mfprintf(stderr, "Error opening file '%s'\n", libtest_arg2);
result = TEST_ERR_MAJOR_BAD; result = TEST_ERR_MAJOR_BAD;
goto test_cleanup; goto test_cleanup;
} }

View file

@ -264,7 +264,7 @@ my @toolhelp; # store all parsed parameters
while(<$r>) { while(<$r>) {
chomp; chomp;
my $l= $_; my $l= $_;
if(/^ \{\" *(.*)/) { if(/^ \{ \" *(.*)/) {
my $str=$1; my $str=$1;
my $combo; my $combo;
if($str =~ /^-(.), --([a-z0-9.-]*)/) { if($str =~ /^-(.), --([a-z0-9.-]*)/) {

View file

@ -126,6 +126,7 @@ static CURLcode test_unit1664(const char *arg)
i, orgline, rc, (int)(line - orgline)); i, orgline, rc, (int)(line - orgline));
} }
} }
{ {
static const char *single[] = { static const char *single[] = {
"a", "a",
@ -169,6 +170,7 @@ static CURLcode test_unit1664(const char *arg)
i, orgline, rc, (int)(line - orgline)); i, orgline, rc, (int)(line - orgline));
} }
} }
{ {
static const char *nums[] = { static const char *nums[] = {
"1", "1",