From 110d3719bb2a85e4034978bb0b03d7fc56a22530 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 8 Mar 2013 13:15:41 -0800 Subject: [PATCH] Use actual root path length Previously a one was added just to use for the length with the null byte when creating the root path passed to fts_open. Closes #391 --- native/v8_extensions/native.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/native/v8_extensions/native.mm b/native/v8_extensions/native.mm index 21f7e6c3a..71a975c8f 100644 --- a/native/v8_extensions/native.mm +++ b/native/v8_extensions/native.mm @@ -166,8 +166,8 @@ namespace v8_extensions { } else if (name == "traverseTree") { std::string argument = arguments[0]->GetStringValue().ToString(); - int rootPathLength = argument.size() + 1; - char rootPath[rootPathLength]; + int rootPathLength = argument.size(); + char rootPath[rootPathLength + 1]; strcpy(rootPath, argument.c_str()); char * const paths[] = {rootPath, NULL};