forked from wolfSSL/wolfssl
GCC-8 string fixes
Fix for the Windows directory search code.
This commit is contained in:
@@ -275,7 +275,7 @@ int wc_ReadDirFirst(ReadDirCtx* ctx, const char* path, char** name)
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
if (ctx->FindFileData.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY) {
|
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) {
|
if (pathLen + dnameLen + 2 > MAX_FILENAME_SZ) {
|
||||||
return BAD_PATH_ERROR;
|
return BAD_PATH_ERROR;
|
||||||
@@ -345,7 +345,7 @@ int wc_ReadDirNext(ReadDirCtx* ctx, const char* path, char** name)
|
|||||||
#ifdef USE_WINDOWS_API
|
#ifdef USE_WINDOWS_API
|
||||||
while (FindNextFileA(ctx->hFind, &ctx->FindFileData)) {
|
while (FindNextFileA(ctx->hFind, &ctx->FindFileData)) {
|
||||||
if (ctx->FindFileData.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY) {
|
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) {
|
if (pathLen + dnameLen + 2 > MAX_FILENAME_SZ) {
|
||||||
return BAD_PATH_ERROR;
|
return BAD_PATH_ERROR;
|
||||||
|
Reference in New Issue
Block a user