Commit 83574bde authored by John Douglas Veitch's avatar John Douglas Veitch
Browse files

Fix stringvector accesses

parent 38825afe
......@@ -1832,7 +1832,14 @@ void LALInferenceParseCharacterOptionString(char *input, char **strings[], UINT4
ProcessParamsTable *LALInferenceParseCommandLine(int argc, char *argv[])
{
return LALInferenceParseStringVector(XLALCreateStringVector(argv));
LALStringVector *args=NULL;
for(int i=0;i<argc;i++)
{
XLALAppendString2Vector(args, argv[i]);
}
ProcessParamsTable *ppt=LALInferenceParseStringVector(args);
XLALDestroyStringVector(args);
return(ppt);
}
ProcessParamsTable *LALInferenceParseStringVector(LALStringVector *arglist)
......@@ -1841,9 +1848,9 @@ ProcessParamsTable *LALInferenceParseStringVector(LALStringVector *arglist)
/* one empty entry. */
{
int i, state=1;
int argc = arglist->count;
int argc = arglist->length;
int dbldash;
char *argv[] = arglist->data;
char **argv = arglist->data;
ProcessParamsTable *head, *ptr=NULL;
/* always (even for argc==1, i.e. no arguments) put one element in list: */
head = (ProcessParamsTable*) XLALCalloc(1, sizeof(ProcessParamsTable));
......
......@@ -763,10 +763,10 @@ ProcessParamsTable *LALInferenceGetProcParamVal(ProcessParamsTable *procparams,c
void LALInferenceParseCharacterOptionString(char *input, char **strings[], UINT4 *n);
/** Return a ProcessParamsTable from the command line arguments */
ProcessParamsTable *LALInferenceParseCommandLine(int argc, char *argv[]);
ProcessParamsTable *LALInferenceParseCommandLine(int argc, char **argv);
/** Return a ProcessParamsTrable from a string vector */
ProcessParamsTable *LALInferenceParseStringVector(LALStringVector *arglist)
ProcessParamsTable *LALInferenceParseStringVector(LALStringVector *arglist);
/** Return a ProcessParamsTable from the command line arguments (SWIG version) */
ProcessParamsTable *LALInferenceParseCommandLineStringVector(LALStringVector *args);
......
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