Hi all, I'm trying to rename a file, based on what the user wants to save it to. The file is called simply "temp", and is deleted when the program exits, but if the user wants to save the progress they can choose to save it with their own filename. Here is my code snippet, it always jumps to "Error saving file".

Code:
char saveName[20];
char accept;
int renameFile = 0;
		
printf("\nSave file to   : ");
scanf("%s",saveName);
strcat(saveName, ".txt");
printf("Filename is    : %s\n",saveName);
printf("Accept? Type Y for yes or N for no : ");
scanf("%s",&accept);
			
if(accept == 'y' || accept == 'Y')
{
	renameFile = rename("temp",saveName);
				
	if(renameFile != 0)
	{
		printf("\nError saving file.\n\n");
	}
}
else if(accept == 'n' || accept == 'N')
{
	printf("\nFilename rejected, progress will not be saved.\n\n");
}
else
{
	printf("\nInvalid choice, progress will not be saved.\n\n");
}