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,6 +22,7 @@
/*
Example gcc build statement
gcc -lwolfssl -lpthread -o tls_bench tls_bench.c
./tls_bench

View File

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

View File

@ -918,6 +918,11 @@ int wolfIO_TcpConnect(SOCKET_T* sockfd, const char* ip, word16 port, int to_sec)
}
#else
#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);
if (ghbn_r_buf != NULL) {
gethostbyname_r(ip, &entry_buf, ghbn_r_buf, 2048, &entry, &ghbn_r_errno);