- wxChar tempFileBuf[256];
- wxGetTempFileName(wxT("mf"), tempFileBuf);
- FILE *fHandle = wxFopen(wxFNCONV(tempFileBuf), _T("wb"));
+ wxString tempFileBuf = wxFileName::CreateTempFileName(wxT("mf"));
+ if (tempFileBuf.empty())
+ return false;
+
+ FILE *fHandle = wxFopen(tempFileBuf.fn_str(), wxT("wb"));