Hi, im trying to write a bunch of strings into a text file which are received through the com port.
every so often though the program gives a fatal error and i get a dialog box which go's something like
it points to line 56 of fprintf.c and says that an "assertion failure" was caused.Quote:
fatal error....
...
str != NULL
i think it might be because its trying to write a string when it hasnt received anything.
im using the code below to write my strings into the file
i have modified it so it doesnt continue when it cant write the string so my new code looks likeCode:fprintf(fp,"%s", decoded);
howver, its still giving me the same error after a few hoursCode:if((fprintf(fp, "\n") || fprintf( fp,"%s", decoded)) == EOF)
{
printf("No string/String error");
}
else{
fprintf(fp,"%s", decoded);
}
Could someone tell me what the error is and what i might be doing wrong?
thanks
VC++ , windows XP