diff --git a/src/common/wxcrt.cpp b/src/common/wxcrt.cpp index 3071e58edc..8a1e427fa1 100644 --- a/src/common/wxcrt.cpp +++ b/src/common/wxcrt.cpp @@ -685,7 +685,8 @@ int wxVsnprintf(wchar_t *str, size_t size, const wxString& format, va_list argpt // VsnprintfTestCase reveals that glibc's implementation of vswprintf // doesn't nul terminate on truncation. - str[size - 1] = 0; + if ( size ) + str[size - 1] = 0; return rv; }