projects
/
wxWidgets.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f4eadf6
)
deal correctly with vsnprintf() implementations which always NUL-terminate the buffer...
author
Vadim Zeitlin
<vadim@wxwidgets.org>
Sun, 29 Oct 2006 15:51:10 +0000
(15:51 +0000)
committer
Vadim Zeitlin
<vadim@wxwidgets.org>
Sun, 29 Oct 2006 15:51:10 +0000
(15:51 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42620
c3d73ce0
-8a6f-49c7-b76d-
6d57e0e08775
src/common/string.cpp
patch
|
blob
|
blame
|
history
diff --git
a/src/common/string.cpp
b/src/common/string.cpp
index e7ab5d2615212a8d975284cec81b404a260d9f9f..8f20b9ac13d3a347fae78413cab446ac81078d71 100644
(file)
--- a/
src/common/string.cpp
+++ b/
src/common/string.cpp
@@
-1815,9
+1815,11
@@
int wxString::PrintfV(const wxChar* pszFormat, va_list argptr)
// current size of the buffer
size *= 2;
}
- else if ( len > size )
+ else if ( len >
=
size )
{
- size = len;
+ // some vsnprintf() implementations NUL-terminate the buffer and
+ // some don't in len == size case, to be safe always add 1
+ size = len + 1;
}
else // ok, there was enough space
{