From a0a180a0adba6be3c567cd89e4bbca3561893e0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Thu, 13 Mar 2014 00:22:50 +0100 Subject: [PATCH] src: fix use of uv_cwd, len includes the NULL byte --- src/node.cc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/node.cc b/src/node.cc index da7c2bcf110..37756e0ba07 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1598,16 +1598,10 @@ static void Cwd(const FunctionCallbackInfo& args) { return env->ThrowUVException(err, "uv_cwd"); } -#ifdef _WIN32 - // TODO(tjfontaine) in the future libuv will report the size include the null - // for now only windows does, remove conditionals after libuv upgrade - cwd_len -= 1; -#endif - Local cwd = String::NewFromUtf8(env->isolate(), buf, String::kNormalString, - cwd_len); + cwd_len - 1); args.GetReturnValue().Set(cwd); }