diff --git a/src/internal.c b/src/internal.c index 5ef5f155..2d3d0ca2 100644 --- a/src/internal.c +++ b/src/internal.c @@ -23887,6 +23887,9 @@ int wolfSSH_CleanPath(WOLFSSH* ssh, char* in, int inSz) byte found; char *path; void *heap = NULL; +#if defined(WOLFSSL_NUCLEUS) || defined(USE_WINDOWS_API) + int j; +#endif if (in == NULL || inSz <= 0) { return WS_BAD_ARGUMENT; @@ -23986,19 +23989,16 @@ int wolfSSH_CleanPath(WOLFSSH* ssh, char* in, int inSz) } /* clean up any multiple drive listed i.e. A:/A: */ - { - int i,j; - sz = (long)WSTRLEN(path); - for (i = 0, j = 0; i < sz; i++) { - if (path[i] == ':') { - if (j == 0) j = i; - else { - /* @TODO only checking once */ - WMEMMOVE(path, path + i - WS_DRIVE_SIZE, - sz - i + WS_DRIVE_SIZE); - path[sz - i + WS_DRIVE_SIZE] = '\0'; - break; - } + sz = (long)WSTRLEN(path); + for (i = 0, j = 0; i < sz; i++) { + if (path[i] == ':') { + if (j == 0) j = i; + else { + /* @TODO only checking once */ + WMEMMOVE(path, path + i - WS_DRIVE_SIZE, + sz - i + WS_DRIVE_SIZE); + path[sz - i + WS_DRIVE_SIZE] = '\0'; + break; } } } diff --git a/tests/regress.c b/tests/regress.c index c8c3016d..0873b4ec 100644 --- a/tests/regress.c +++ b/tests/regress.c @@ -32,7 +32,9 @@ #include #include -#include +#ifndef _WIN32 + #include +#endif #include #include #include