From: Vadim Zeitlin Date: Thu, 11 Sep 2003 21:13:02 +0000 (+0000) Subject: fix for C99-compatible vsnprintf() X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/530c90012aa7a0c9dadd9f109078913eb3843db1?ds=inline fix for C99-compatible vsnprintf() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23539 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/toback24.txt b/docs/toback24.txt index a0f0758650..0dcd13c905 100644 --- a/docs/toback24.txt +++ b/docs/toback24.txt @@ -270,40 +270,16 @@ Checking in sizer.cpp; /pack/cvsroots/wxwindows/wxWindows/src/common/sizer.cpp,v <-- sizer.cpp new revision: 1.71; previous revision: 1.70 - 28. patch [ 771772 ] Crashes when setting icon tooltip longer than 63 characters Checking in window.cpp; /pack/cvsroots/wxwindows/wxWindows/src/msw/window.cpp,v <-- window.cpp new revision: 1.431; previous revision: 1.430 -done -#if wxUSE_UNICODE - // in Unicode mode this is just what we need - ttText->lpszText = (wxChar *)ttip.c_str(); -#else // !Unicode - // Fix by dimitrishortcut: see patch 771772 - - // FIXME: szText has a max of 80 bytes, so limit the tooltip string - // length accordingly. Ideally lpszText should be used, but who - // would be responsible for freeing the buffer? - - // Maximum length of a tip is 39 characters. 39 is 80/2 minus 1 byte - // needed for NULL character. - size_t tipLength = wxMin(ttip.Len(), 39); - - // Convert to WideChar without adding the NULL character. The NULL - // character is added afterwards (Could have used ttip.Left(tipLength) - // and a cchMultiByte parameter of tipLength+1, but this is more - //efficient. - ::MultiByteToWideChar(CP_ACP, 0, ttip, tipLength, - (wchar_t *)ttText->szText, - sizeof(ttText->szText) / sizeof(wchar_t)); - - // Add the NULL character. - ttText->szText[tipLength*2+0] = '\0'; - ttText->szText[tipLength*2+1] = '\0'; -#endif // Unicode/!Unicode +29. Fix wxString::Format() for C99-compatible vsnprintf() +Checking in src/common/string.cpp; +/pack/cvsroots/wxwindows/wxWindows/src/common/string.cpp,v <-- string.cpp +new revision: 1.194; previous revision: 1.193 TODO for 2.4 (items that are not backports)