summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2009-10-04 14:36:01 +0000
committerChristian Pointner <equinox@anytun.org>2009-10-04 14:36:01 +0000
commite35d4b7d0af7466a1e76ad26606ace7ec9c37081 (patch)
treefb83c156db0e5091805a0d833b950c1160d211bc /src
parentadded improved script execution (diff)
fixed bug @ new exec
Diffstat (limited to 'src')
-rw-r--r--src/sysExec.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/sysExec.cpp b/src/sysExec.cpp
index 9a397a2..ca62dfd 100644
--- a/src/sysExec.cpp
+++ b/src/sysExec.cpp
@@ -104,8 +104,7 @@ void anytun_exec(std::string const& script, StringVector const& args, StringList
argv[i+1] = new char[args[i].size() + 1];
std::strcpy(argv[i+1], args[i].c_str());
}
- argv[args.size() + 1] = new char[1];
- argv[args.size() + 1][0] = NULL;
+ argv[args.size() + 1] = NULL;
char** evp;
if(env.size()) {
@@ -116,12 +115,10 @@ void anytun_exec(std::string const& script, StringVector const& args, StringList
std::strcpy(evp[i], it->c_str());
++i;
}
- evp[env.size()] = new char[1];
- evp[env.size()][0] = NULL;
+ evp[env.size()] = NULL;
} else {
evp = new char*[1];
- evp[0] = new char[1];
- evp[0][0] = NULL;
+ evp[0] = NULL;
}
execve(script.c_str(), argv, evp);