I have this code that works (it's a bit stripped down):
char *parmList[6];
parmList[0] ="/root/ssl_send";
parmList[1] ="-m 1";
...etc...
parmList[5] = NULL;
execvp(parmList[0], parmList);
Now I want to write something to one string in this list with sprintf (it's more correct to say that I want that one pointer of *parmList[6] points to a char array constructed with sprintf). I am getting "Segmentation errors" all the time. I have tried:
- using malloc,
- declaring a double array so the memory space is reserved,
- using snprintf,....
I am obviously doing something wrong. The problem is similliar to Sprintf Segmentation Fault, just that I need to have a list of pointers/char_arrays for execvp.