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
This commit is contained in:
Kevin Sawicki 2013-03-08 13:15:41 -08:00
parent 1561f22853
commit 110d3719bb

View File

@ -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};