summaryrefslogtreecommitdiff
path: root/project2/processes/processStream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'project2/processes/processStream.cpp')
-rw-r--r--project2/processes/processStream.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/project2/processes/processStream.cpp b/project2/processes/processStream.cpp
index f2c678f..1ed8388 100644
--- a/project2/processes/processStream.cpp
+++ b/project2/processes/processStream.cpp
@@ -23,13 +23,12 @@ class ProcessStream : public Stream, IHaveParameters {
void runStream(const Sink & sink, ExecContext * ec) const
{
- const char * callProc[parameters.size() + 2];
- callProc[0] = path(ec);
- int pidx = 1;
+ std::vector<std::string> callProc;
+ callProc.reserve(parameters.size() + 2);
+ callProc.push_back(path(ec));
BOOST_FOREACH(const Parameters::value_type & p, parameters) {
- callProc[pidx++] = p.second(ec);
+ callProc.push_back(p.second(ec));
}
- callProc[pidx] = NULL;
int fds[2];
popenrw(callProc, fds);