fprintf函数出错
程序代码:
void file_write(char *a,FILE * file,int k) { if(k) fprintf(file," "); fprintf(file,"%s",a); fprintf(file,"\r\n",a);
当file_write里char *a 字符串为ifuckyouESRT$%#@时出错(最后有一个\0)
Debug Assertion Failed!
Program:E\CHANGE.exe
File:f:\dd\vctools\crt_bld\self_x86\crt\src\fprintf.c
Line:55
Expression:(str!=NULL)
For information on how your program can cause an assertion failure,see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
fprintf.c line:49-59 加黑部分为出错位置
程序代码:
{ va_list(arglist); FILE *stream; int buffing; int retval=0; _VALIDATE_RETURN((str!=NULL),EINVAL,-1); _VALIDATE_RETURN((format!=NULL),EINVAL,-1); _CHECK_IO_INIT(-1); va_start(arglist,format);