From 7053830628a185cdc9eb0c1fb5d58f56dc930cab Mon Sep 17 00:00:00 2001 From: John Safranek Date: Fri, 22 Jun 2018 11:36:25 -0700 Subject: [PATCH] GCC-8 string fixes Fix for the Windows directory search code. --- wolfcrypt/src/wc_port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/src/wc_port.c b/wolfcrypt/src/wc_port.c index 9e6884e13..c8723e4c8 100644 --- a/wolfcrypt/src/wc_port.c +++ b/wolfcrypt/src/wc_port.c @@ -275,7 +275,7 @@ int wc_ReadDirFirst(ReadDirCtx* ctx, const char* path, char** name) do { if (ctx->FindFileData.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY) { - dnameLen = (int)XSTRLEN(ctx->entry->d_name); + dnameLen = (int)XSTRLEN(ctx->FindFileData.cFileName); if (pathLen + dnameLen + 2 > MAX_FILENAME_SZ) { return BAD_PATH_ERROR; @@ -345,7 +345,7 @@ int wc_ReadDirNext(ReadDirCtx* ctx, const char* path, char** name) #ifdef USE_WINDOWS_API while (FindNextFileA(ctx->hFind, &ctx->FindFileData)) { if (ctx->FindFileData.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY) { - dnameLen = (int)XSTRLEN(ctx->entry->d_name); + dnameLen = (int)XSTRLEN(ctx->FindFileData.cFileName); if (pathLen + dnameLen + 2 > MAX_FILENAME_SZ) { return BAD_PATH_ERROR;