title: CString::Format() causes debug assertion
body: <p>Cstring::Format causes debug assertion in visual studio 2008 at vsprintf.c line 244 with "buffer too small".</p>
  
  <pre><code>//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 
  </code></pre>
  
  <p>Any idea why CString::Format() causes "buffer too small" error ? This doesn't always get debug assertion error.</p>