Merge pull request #4787 from douzzer/20220121-fixits-20220118-clang-tidy

cleanup re #4772
This commit is contained in:
David Garske
2022-01-21 12:46:07 -08:00
committed by GitHub
4 changed files with 16 additions and 11 deletions

View File

@ -22,13 +22,14 @@
/* /*
Example gcc build statement Example gcc build statement
gcc -lwolfssl -lpthread -o tls_bench tls_bench.c
./tls_bench gcc -lwolfssl -lpthread -o tls_bench tls_bench.c
./tls_bench
Or Or
#include <examples/benchmark/tls_bench.h> #include <examples/benchmark/tls_bench.h>
bench_tls(args); bench_tls(args);
*/ */

View File

@ -99,7 +99,6 @@ void echoclient_test(void* args)
argv = ((func_args*)args)->argv; argv = ((func_args*)args)->argv;
if (argc >= 2) { if (argc >= 2) {
fprintf(stderr,"fopen(%s,r)\n",argv[1]);
fin = fopen(argv[1], "r"); fin = fopen(argv[1], "r");
inCreated = 1; inCreated = 1;
} }

View File

@ -918,6 +918,11 @@ int wolfIO_TcpConnect(SOCKET_T* sockfd, const char* ip, word16 port, int to_sec)
} }
#else #else
#if (__GLIBC__ >= 2) && defined(__USE_MISC) && !defined(SINGLE_THREADED) #if (__GLIBC__ >= 2) && defined(__USE_MISC) && !defined(SINGLE_THREADED)
/* 2048 is a magic number that empirically works. the header and
* documentation provide no guidance on appropriate buffer size other than
* "if buf is too small, the functions will return ERANGE, and the call
* should be retried with a larger buffer."
*/
ghbn_r_buf = (char *)XMALLOC(2048, NULL, DYNAMIC_TYPE_TMP_BUFFER); ghbn_r_buf = (char *)XMALLOC(2048, NULL, DYNAMIC_TYPE_TMP_BUFFER);
if (ghbn_r_buf != NULL) { if (ghbn_r_buf != NULL) {
gethostbyname_r(ip, &entry_buf, ghbn_r_buf, 2048, &entry, &ghbn_r_errno); gethostbyname_r(ip, &entry_buf, ghbn_r_buf, 2048, &entry, &ghbn_r_errno);

View File

@ -2671,12 +2671,12 @@ static void test_wolfSSL_CTX_ticket_API(void)
static void test_wolfSSL_set_minmax_proto_version(void) static void test_wolfSSL_set_minmax_proto_version(void)
{ {
#ifdef OPENSSL_EXTRA #ifdef OPENSSL_EXTRA
WOLFSSL_CTX *ctx; WOLFSSL_CTX *ctx;
WOLFSSL *ssl; WOLFSSL *ssl;
int ret; int ret;
(void)ret; (void)ret;
(void)ssl; (void)ssl;
printf(testingFmt, "test_wolfSSL_set_minmax_proto_version"); printf(testingFmt, "test_wolfSSL_set_minmax_proto_version");
#ifndef NO_WOLFSSL_CLIENT #ifndef NO_WOLFSSL_CLIENT
AssertNotNull(ctx = wolfSSL_CTX_new(wolfSSLv23_client_method())); AssertNotNull(ctx = wolfSSL_CTX_new(wolfSSLv23_client_method()));