From 1b81dba8920b01508452caa32aba28b6006f85c4 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Mon, 17 Apr 2006 01:01:14 +0000 Subject: [PATCH] ignorance is bliss Originally committed to SVN as r348. --- core/text_file_writer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/text_file_writer.cpp b/core/text_file_writer.cpp index ec87508a3..ac5342ebf 100644 --- a/core/text_file_writer.cpp +++ b/core/text_file_writer.cpp @@ -119,6 +119,8 @@ void TextFileWriter::WriteLineToFile(wxString line,bool addLineBreak) { // 16-bit if (Is16) { wxWCharBuffer buf = temp.wc_str(*conv); + if (!buf.data()) + return; size_t len = wcslen(buf.data())*2; file.write((const char*)buf.data(),len); } @@ -126,6 +128,8 @@ void TextFileWriter::WriteLineToFile(wxString line,bool addLineBreak) { // 8-bit else { wxCharBuffer buf = temp.mb_str(*conv); + if (!buf.data()) + return; size_t len = strlen(buf.data()); file.write(buf.data(),len); }