]> git.saurik.com Git - wxWidgets.git/commit - src/common/convauto.cpp
Correct wxConvAuto::ToWChar() behaviour with wxNO_LEN input size.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 3 Oct 2010 17:15:18 +0000 (17:15 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 3 Oct 2010 17:15:18 +0000 (17:15 +0000)
commit9334ad1727a9906a98e7a58f616ef617fd466771
tree5ad6a8d646071da2111ed76c42b7a00f21165e26
parent051d655703d708e19a703d5d16f9f88a753a12af
Correct wxConvAuto::ToWChar() behaviour with wxNO_LEN input size.

We didn't handle the case when the length of the input buffer was not
specified correctly and wxConvAuto::DetectBOM() could read beyond the end of
input. Moreover, the unit test actually relied on this as it didn't pass the
correct length for the literal strings with embedded NULs. This somehow worked
with MSVC but failed with MinGW (see #10713).

Correct the code to handle wxNO_LEN case correctly and fix the unit test to
pass the correct lengths.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65739 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
src/common/convauto.cpp
tests/mbconv/convautotest.cpp