projects
/
wxWidgets.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8145496
)
Test for encoding conversion success in wxFFile::Write to avoid crash
author
Julian Smart
<julian@anthemion.co.uk>
Sat, 24 Mar 2007 10:20:14 +0000
(10:20 +0000)
committer
Julian Smart
<julian@anthemion.co.uk>
Sat, 24 Mar 2007 10:20:14 +0000
(10:20 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45041
c3d73ce0
-8a6f-49c7-b76d-
6d57e0e08775
include/wx/ffile.h
patch
|
blob
|
blame
|
history
diff --git
a/include/wx/ffile.h
b/include/wx/ffile.h
index 58aca44eafa46d6341b6ebb0387aed30fa2130f5..1a4c3c0de8f31dfe95486f930a3f2f2fe1cc1f84 100644
(file)
--- a/
include/wx/ffile.h
+++ b/
include/wx/ffile.h
@@
-65,8
+65,13
@@
public:
bool Write(const wxString& s, const wxMBConv& conv = wxConvAuto())
{
const wxWX2MBbuf buf = s.mb_str(conv);
- size_t size = strlen(buf);
- return Write((const char *)buf, size) == size;
+ if (buf)
+ {
+ size_t size = strlen(buf);
+ return Write((const char *)buf, size) == size;
+ }
+ else
+ return false;
}
// flush data not yet written
bool Flush();