S
sail0r
Perhaps this is obvious but I am not sure what is going on...
Here is the relevant code:
char *command;
char *argument;
char url[]="file:///usr/u/myname/Project/cats/";
char target_path[]="/tmp/abc";
command=strtok(buf,":\n\r");
argument=strtok(NULL,"\n\r");
/*now, I want to strcat argument onto both url and target_path */
strcat(url,argument);
strcat(target_path,argument);
But that doesn't work as I expect it to. Why?
What I am seeing is that the first strcat work but the second one
has a result string that is all discombobulated somehow?
Any advice would be greatly appreciated!
Here is the relevant code:
char *command;
char *argument;
char url[]="file:///usr/u/myname/Project/cats/";
char target_path[]="/tmp/abc";
command=strtok(buf,":\n\r");
argument=strtok(NULL,"\n\r");
/*now, I want to strcat argument onto both url and target_path */
strcat(url,argument);
strcat(target_path,argument);
But that doesn't work as I expect it to. Why?
What I am seeing is that the first strcat work but the second one
has a result string that is all discombobulated somehow?
Any advice would be greatly appreciated!