Cstring::Format により、Visual Studio 2008 の vsprintf.c 行 244 で「バッファが小さすぎます」というデバッグ アサーションが発生します。
//inside the function.
somefile.Open (//open for mode read) //somefile is CFile.
char* buff = new [somefile.GetLength()];
somefile.Read ((void*)buff, somefile.GetLength());
CString cbuff;
cbuff.Format ("%s",buff); //this line causes the debug assertion.
//and so on
CString::Format() が「バッファが小さすぎます」というエラーを引き起こす理由は何ですか? これは、常にデバッグ アサーション エラーになるとは限りません。