im sure the problem is right in front of me, but my functions doesnt seem to work right. its supposed to create a output file name by taking the input's and adding a .html ending to it.
Code:
if(output == NULL) {
spot = strrchr(input, '.');
output = malloc( strlen(spot) + 5 );
strncpy(output, input, (spot - input -1 )); //-1
strcat(output, ".html");
}
if i run this with the input file being test.txt, i get a output file of tes.txt i tried playing with the numbers, -1 is the closes it gets.
what completly obvious thing here am i missing?