mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-04-28 22:13:23 +02:00
Fix for wc_ReadDirFirst to return non-zero value if no files found. Fix for wolfSSL_CTX_load_verify_locations to not return failure due to wc_ReadDirNext “no more files” -1 response.
This commit is contained in:
@@ -197,9 +197,10 @@ int wolfCrypt_Cleanup(void)
|
||||
#if !defined(NO_FILESYSTEM) && !defined(NO_WOLFSSL_DIR)
|
||||
|
||||
/* File Handling Helpers */
|
||||
/* returns 0 if file found, -1 if no files or negative error */
|
||||
int wc_ReadDirFirst(ReadDirCtx* ctx, const char* path, char** name)
|
||||
{
|
||||
int ret = 0;
|
||||
int ret = -1; /* default to no files found */
|
||||
|
||||
if (name)
|
||||
*name = NULL;
|
||||
@@ -258,9 +259,10 @@ int wc_ReadDirFirst(ReadDirCtx* ctx, const char* path, char** name)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* returns 0 if file found, -1 if no more files */
|
||||
int wc_ReadDirNext(ReadDirCtx* ctx, const char* path, char** name)
|
||||
{
|
||||
int ret = -1;
|
||||
int ret = -1; /* default to no file found */
|
||||
|
||||
if (name)
|
||||
*name = NULL;
|
||||
|
||||
Reference in New Issue
Block a user