diff --git a/reactos/lib/sdk/crt/misc/environ.c b/reactos/lib/sdk/crt/misc/environ.c index 343d8a3d412..24481939017 100644 --- a/reactos/lib/sdk/crt/misc/environ.c +++ b/reactos/lib/sdk/crt/misc/environ.c @@ -1,4 +1,4 @@ -/* +/* * environ.c * * ReactOS MSVCRT.DLL Compatibility Library @@ -64,11 +64,11 @@ int BlockEnvToEnvironA(void) { if ((*envptr = malloc(len)) == NULL) { - for (envptr--; envptr >= _environ; envptr--); + for (envptr--; envptr >= _environ; envptr--) free(*envptr); FreeEnvironmentStringsA(environment_strings); free(_environ); - __initenv = _environ = NULL; + __initenv = _environ = NULL; return -1; } memcpy(*envptr++, ptr, len); @@ -116,11 +116,11 @@ int BlockEnvToEnvironW(void) { if ((*envptr = malloc(len * sizeof(wchar_t))) == NULL) { - for (envptr--; envptr >= _wenviron; envptr--); + for (envptr--; envptr >= _wenviron; envptr--) free(*envptr); FreeEnvironmentStringsW(environment_strings); free(_wenviron); - __winitenv = _wenviron = NULL; + __winitenv = _wenviron = NULL; return -1; } memcpy(*envptr++, ptr, len * sizeof(wchar_t)); @@ -168,7 +168,7 @@ char **DuplicateEnvironment(char **original_environment, int wide) *newenvptr = _strdup(*envptr++); if (*newenvptr == NULL) { - for (newenvptr--; newenvptr >= newenv; newenvptr--); + for (newenvptr--; newenvptr >= newenv; newenvptr--) free(*newenvptr); free(newenv); return original_environment; diff --git a/reactos/lib/sdk/crt/stdio/stat.c b/reactos/lib/sdk/crt/stdio/stat.c index 39df882ed34..e72df1d96f2 100644 --- a/reactos/lib/sdk/crt/stdio/stat.c +++ b/reactos/lib/sdk/crt/stdio/stat.c @@ -2,6 +2,7 @@ #include #define stat64_to_stat(buf64, buf) \ + do { \ buf->st_dev = (buf64)->st_dev; \ buf->st_ino = (buf64)->st_ino; \ buf->st_mode = (buf64)->st_mode; \ @@ -13,6 +14,7 @@ buf->st_atime = (time_t)(buf64)->st_atime; \ buf->st_mtime = (time_t)(buf64)->st_mtime; \ buf->st_ctime = (time_t)(buf64)->st_ctime; \ + } while (0) int CDECL _tstat(const _TCHAR* path, struct _stat * buf) {