Gudday
Still trying to catch up C programming after no activity for a decade.
I want to strip a trailing " off a string so that the string can be used to move a file but the program is crashing
The string in question (known as tiffUrl) looks like
Code:
\\Au-mobius-e\E20-120_Scan\PICKLIST\0000544A.TIF"
The " at the end is the problem.
I thought that copying the string, except for the last char (the ") would do the trick but alas it does not work

Code:
char *tiffUrl="";   //string contains where TIFF file will end up
char *tmp="";     //temporary holder to remove trailing " in tiffUrl

....

tiffUrl= (fileline + strlen(fileline) - (strlen(fileline)-index));
printf("Length of tiffUrl is %i\n", strlen(tiffUrl));
for(x=0;x<(strlen(tiffUrl)-1);x++) {
   printf("x=%i\n", x);
   tmp[x] = tiffUrl[x];
}
printf("new tiffUrl is %s\n", tmp);
The code prints out x =0 ok then crashes.

[once I get the code working I was going to copy tmp back to tiffUrl using
Code:
tiffUrl = tmp;
Is this ok or should I do use strcpy?