im working on a little text to html conversion program. i have a function to create a title(1 param), function to chacge inputted name into a output-able name(t param, old filename and extension) and the function that does the work( 3 params, input file, output file and the title). when ever i call the main function using separte functions, all the varibles are the same. why!?!?!?!?
i have tried this a couple of different ways, and the funny part is it has worked in a function before(a function to chage the inputted filename to a output-able file).

heres some unfinished code of it
==============================================
# include <stdio.h>
# include <string.h>
# include <ctype.h>

int main(int argc, char *argv[]) {
process(argv[1], convertfileext(argv[1], ".html") );
}

int convertfileext(char name[], char ext[]) {
int x = strlen(name);
int converted = 0;

while(name[x] != EOF) {
if(name[x] == '.') {
name[x] = '\0';
name = strcat(name, ext);

converted = 1;
break;
}

--x;
}

if(converted == 0)
name = strcat(name, ext);

return name;
}

int createtitle(char filename[]) {
int x = 0;

filename[0] = toupper(filename[0]);
while(filename[x] != EOF) {
if(filename[x] == '_')
filename[x] = ' ';
else if(filename[x] == ' ')
filename[x+1] = toupper(filename[x+1]);

++x;
}

return filename;
}

int process(char path[], char newfile[]) {
printf("\n%s\n", path);
printf("%s\n", newfile);

return 0;
}

==============================================
the process function prints newfile out twice for me. i tried this on windows xp and in red hat linux 7.3, what is happening here!?!?!?

thanks