Fixed modification of parameters
Monitor parameters were being modified in externcmd_allocate which caused truncation of the arguments to the commands.
This commit is contained in:
@ -6,15 +6,17 @@
|
|||||||
* @param argv Array of char pointers to be filled with tokenized arguments
|
* @param argv Array of char pointers to be filled with tokenized arguments
|
||||||
* @return 0 on success, -1 on error
|
* @return 0 on success, -1 on error
|
||||||
*/
|
*/
|
||||||
int tokenize_arguments(char* args, char** argv)
|
int tokenize_arguments(char* argstr, char** argv)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
bool quoted = false;
|
bool quoted = false;
|
||||||
bool read = false;
|
bool read = false;
|
||||||
bool escaped = false;
|
bool escaped = false;
|
||||||
char *ptr,*start;
|
char *ptr,*start;
|
||||||
|
char args[strlen(argstr)];
|
||||||
char qc;
|
char qc;
|
||||||
|
|
||||||
|
strcpy(args, argstr);
|
||||||
start = args;
|
start = args;
|
||||||
ptr = start;
|
ptr = start;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user