win: fix var declaration to be C89 compliant
Visual Studio 2013+ relaxed variable declaration C89 compliance; older compilers are strict (e.g. VS 2008 - 2012). PR-URL: https://github.com/libuv/libuv/pull/815 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This commit is contained in:
parent
7acb6bd843
commit
3819e48277
@ -66,11 +66,12 @@ static void uv_fs_event_queue_readdirchanges(uv_loop_t* loop,
|
||||
static void uv_relative_path(const WCHAR* filename,
|
||||
const WCHAR* dir,
|
||||
WCHAR** relpath) {
|
||||
size_t relpathlen;
|
||||
size_t filenamelen = wcslen(filename);
|
||||
size_t dirlen = wcslen(dir);
|
||||
if (dirlen > 0 && dir[dirlen - 1] == '\\')
|
||||
dirlen--;
|
||||
size_t filenamelen = wcslen(filename);
|
||||
size_t relpathlen = filenamelen - dirlen - 1;
|
||||
relpathlen = filenamelen - dirlen - 1;
|
||||
*relpath = uv__malloc((relpathlen + 1) * sizeof(WCHAR));
|
||||
if (!*relpath)
|
||||
uv_fatal_error(ERROR_OUTOFMEMORY, "uv__malloc");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user