ofstream によって作成されたファイルに buf ポインタの内容を書き込もうとしています。
何らかの理由でファイルは空ですが、 buf の内容は決して空ではありません...何が間違っていますか?
void DLog::Log(const char *fmt, ...)
{
va_list varptr;
va_start(varptr, fmt);
int n = ::_vscprintf(fmt, varptr);
char *buf = new char[n + 1];
::vsprintf(buf, fmt, varptr);
va_end(varptr);
if (!m_filename.empty())
{
std::ofstream ofstr(m_filename.c_str(), ios::out);
ofstr << *buf; // contents of *buf are NEVER empty, however nothing is in file??
ofstr.close();
}
delete [] buf;
}