Debug版本下报Run-Time Check Failure #2 - Stack around the variable 'temp' was corrupted.
Release版本下运行无些错误。部分部分代码如下:
int nType=3;
char temp[200]="\0";
char line[5]="";
sprintf(line,"%c%c",JCBGBH[5],JCBGBH[6]);
//webserver
if(zhweb.writeObjectOut("D","3",line,data))
{
GetLocalTime(&t);
sprintf(temp,"检测结果发送成功! %04d-%02d-%02d %02d:%02d:%02d.%03d \r\n%s\r\n",t.wYear,t.wMonth,t.wDay,t.wHour,t.wMinute,t.wSecond,t.wMilliseconds,data);
logfile.AppendText((LPCTSTR)temp);
logfile.AppendText((LPCTSTR)JCBGBH);
}
把temp数组改成1000解决
注意:本文归作者所有,未经作者允许,不得转载