diff --git a/desmume/src/emufile.h b/desmume/src/emufile.h index 97197db12..8de07045a 100644 --- a/desmume/src/emufile.h +++ b/desmume/src/emufile.h @@ -107,12 +107,9 @@ public: int amt = vsnprintf(0,0,format,argptr); char* tempbuf = new char[amt+1]; vsprintf(tempbuf,format,argptr); - memcpy((char*)buf()+pos,tempbuf,amt); - pos += amt; - len = std::max(pos,len); - + fwrite(tempbuf,amt); + delete[] tempbuf; va_end(argptr); - return amt; };