I have a program that runs correctly if I start it manually. However, if I try to add a registry key to start it automatically during startup, I get this error:
Debug assertion failed (str!=null) fprintf.c line:55
I tried to add Sleep(20000) before anything happens, but I get the same error.
Here's the code:
main()
{
FILE* filetowrite;
filetowrite = fopen("textfile.txt", "a+");
writefunction(filetowrite);
}
int writefunction(FILE* filetowrite) {
fprintf(filetowrite, "%s", "\n\n");
...
}
I also tried passing the filename as char* and opening it in writefunction(), but I get the same error.