Commit 7c63f999 authored by Jason Hiser's avatar Jason Hiser 🚜

fix arg parsing issue with getopts

parent aad5c637
......@@ -37,16 +37,14 @@ using namespace IRDB_SDK;
class StackStampDriver_t : public IRDB_SDK::TransformStep_t
{
public:
int parseArgs(const vector<string> step_args) override
{
/* convert to argv format for esay parsing wth getopts */
auto argv = vector<char*>();
auto argv = vector<char*>({const_cast<char*>("libstack_stamp.so")});
transform(ALLOF(step_args), back_inserter(argv), [](const string &s) -> char* { return const_cast<char*>(s.c_str()); } );
const auto argc=step_args.size();
const auto argc=argv.size();
srand(getpid()+time(NULL));
stamp_value=rand();
......@@ -65,7 +63,7 @@ class StackStampDriver_t : public IRDB_SDK::TransformStep_t
while(true)
{
auto index = 0;
auto c = getopt_long(argc, &argv[0],short_opts, long_options, &index);
auto c = getopt_long(argc, &argv[0], short_opts, long_options, &index);
if(c == -1)
break;
switch(c)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment