Buffer too small
2013-07-30 13:29
274 查看
在项目中用到了CString,后来发现在Format的时候会报Buffer too small的错误,在网上查资料发现时这样的
在使用Format函数的时候,不用以自己作为函数参数,否则就会出现Buffer too small的情况
CString output ; int size = m_NicInfo.size(); output.Format(_T("共%d块网卡\r\n"),size); //VE_NicINFO_IT it = this->m_NicInfo.begin(); //for(; it != m_NicInfo.end(); ++it){ // CString tmp; // tmp.Format(_T("网卡GUID:%s\r\n"),it->NicGUID); // output += tmp; // tmp.Format(_T("网卡描述:%s\r\n"),it->NicDesc); // output += tmp; // tmp.Format(_T("网卡名称:%s\r\n"),it->NicName); // output += tmp; // tmp.Format(_T("网卡注册表中INDEX:%s\r\n"),it->NicClassIndex); // output += tmp; //} for(int pos = 0; pos < size ; pos++) { CString tmp; tmp.Format(_T("网卡GUID:%s\r\n"),m_NicInfo.at(pos).NicGUID); output += tmp; tmp.Format(_T("网卡描述:%s\r\n"),m_NicInfo.at(pos).NicDesc); output += tmp; tmp.Format(_T("网卡名称:%s\r\n"),m_NicInfo.at(pos).NicName); output += tmp; tmp.Format(_T("网卡注册表中INDEX:%s\r\n"),m_NicInfo.at(pos).NicClassIndex); output += tmp; } writeLog(output);
在使用Format函数的时候,不用以自己作为函数参数,否则就会出现Buffer too small的情况
相关文章推荐
- VC程序提示 Expression:("Buffer too small",0) 错误
- TypeError: buffer is too small for requested array python 问题处理
- CString.Format调用失败另一例(buffer too small vsprintf.c Line:244)
- ORA-06502:PL/SQL :numberic or value error: character string buffer too small
- ORA-06502: PL/SQL: numeric or value error: character string buffer too small
- Buffer is too small
- strcpy_s Buffer is too small 出错根本原因
- ORACLE 函数处理的数据返回值过长 character string buffer too small , WMSYS.WM_CONCAT
- ORA-06502: PL/SQL: numeric or value error: character string buffer too small
- ORA-06502:PL/SQL :numberic or value error: character string buffer too small
- C中strcpy_s出现“buffer is too small …… ”问题
- Oracle Error : ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 3000, maximum: 4000)
- buffer too small
- 最近项目在运行时出现"Buffer too small"
- 关于sprintf_s,弹出Expression:(“Buffer too small”,0)
- str.Format 错误 Buffer too small
- the attribute buffer size is too small 解决方法
- xsql---Buffer too small for record data
- PHP调用Oracle存储过程时的错误:ORA-06502: PL/SQL: numeric or value error: character string buffer too small
- How to solve (Buffer too Small".0) problem?