Implement peer review feedback

Fix items that were missed from peer review

Remove dead code

Add ret capture of return from XVSNPRINTF
This commit is contained in:
kaleb-himes
2021-03-17 09:37:22 -06:00
parent 1d5d946273
commit b3eb2e3ddd
4 changed files with 10 additions and 20 deletions

View File

@ -4577,8 +4577,6 @@ static void bench_rsa_helper(int doAsync, RsaKey rsaKey[BENCH_MAX_PENDING],
/* MDK5 compiler regard this as a executable statement, and does not allow declarations after the line. */
DECLARE_ARRAY_DYNAMIC_DEC(enc, byte, BENCH_MAX_PENDING, rsaKeySz, HEAP_HINT);
#else
int idxenc;
int inner_idx_enc;
byte* enc[BENCH_MAX_PENDING];
#endif
#if !defined(WOLFSSL_RSA_VERIFY_INLINE) && !defined(WOLFSSL_RSA_PUBLIC_ONLY)
@ -4586,8 +4584,6 @@ static void bench_rsa_helper(int doAsync, RsaKey rsaKey[BENCH_MAX_PENDING],
/* MDK5 compiler regard this as a executable statement, and does not allow declarations after the line. */
DECLARE_ARRAY_DYNAMIC_DEC(out, byte, BENCH_MAX_PENDING, rsaKeySz, HEAP_HINT);
#else
int idxout;
int inner_idx_out;
byte* out[BENCH_MAX_PENDING];
#endif
#else

View File

@ -441,11 +441,7 @@ int wc_ReadDirFirst(ReadDirCtx* ctx, const char* path, char** name)
XSTRNCPY(ctx->name, path, MAX_FILENAME_SZ - 3);
XSTRNCPY(ctx->name + pathLen, "\\*", MAX_FILENAME_SZ - pathLen);
#ifdef _WIN32_WCE
ctx->hFind = FindFirstFileA((LPCWSTR) ctx->name, &ctx->FindFileData);
#else
ctx->hFind = FindFirstFileA(ctx->name, &ctx->FindFileData);
#endif
if (ctx->hFind == INVALID_HANDLE_VALUE) {
WOLFSSL_MSG("FindFirstFile for path verify locations failed");
return BAD_PATH_ERROR;

View File

@ -561,7 +561,7 @@ decouple library dependencies with standard string, memory and so on.
va_start(ap, format);
ret = vsnprintf(s, n, format, ap);
ret = XVSNPRINTF(s, n, format, ap);
if (ret < 0)
ret = -1;
@ -597,11 +597,7 @@ decouple library dependencies with standard string, memory and so on.
if ((int)bufsize <= 0) return -1;
va_start(ap, format);
#ifndef _WIN32_WCE
ret = vsnprintf(buffer, bufsize, format, ap);
#else
ret = _vsnprintf(buffer, bufsize, format, ap);
#endif
ret = XVSNPRINTF(buffer, bufsize, format, ap);
if (ret >= (int)bufsize)
ret = -1;
va_end(ap);

View File

@ -631,6 +631,7 @@ WOLFSSL_API int wolfCrypt_Cleanup(void);
#define XSEEK_END SEEK_END
#define XBADFILE NULL
#define XFGETS fgets
#define XVSNPRINTF _vsnprintf
#elif defined(FUSION_RTOS)
#include <fclstdio.h>
@ -883,7 +884,8 @@ WOLFSSL_API int wolfCrypt_Cleanup(void);
time_t windows_time(time_t* timer);
#define FindNextFileA(h, d) FindNextFile(h, (LPWIN32_FIND_DATAW) d)
#define FindFirstFileA(fn, d) FindFirstFile(fn, (LPWIN32_FIND_DATAW) d)
#define FindFirstFileA(fn, d) FindFirstFile((LPCWSTR) fn, \
(LPWIN32_FIND_DATAW) d)
#define XTIME(t1) windows_time((t1))
#define WOLFSSL_GMTIME