lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] wx_test: output strings truncated to one character


From: Vadim Zeitlin
Subject: Re: [lmi] wx_test: output strings truncated to one character
Date: Wed, 10 Feb 2016 15:31:46 +0100

On Tue, 9 Feb 2016 15:54:50 +0000 Greg Chicares <address@hidden> wrote:

GC> Building and running lmi (HEAD) in msw-7, we observe that this
GC> code in 'wx_test_about_version.cpp':
GC>   // Extract the last word of the dialog title.
GC>   wxString const last_word = d->GetTitle().AfterLast(' ');
GC>   wxPrintf("About dialog version string is \"%s\".\n", last_word);
GC>   LMI_ASSERT_EQUAL(last_word, LMI_VERSION);
GC> prints:
GC>   About dialog version string is "2".
GC> but LMI_VERSION is:
GC>   #define LMI_VERSION "20160114T1914Z"
GC> and the assertion above succeeds, so it seems that the wxString
GC> is correct but something is wrong with wxPrintf().

 This is fixed by

https://github.com/wxWidgets/wxWidgets/commit/06458cb89fb8449f377b0b782404b9a9cbe3ae2d

which should work in all cases. As you can see, the fix itself is trivial,
it's just testing it with the different MinGW compilers/versions/modes
(-std=xxx) that was not.

 I don't see any mechanism by which this bug could result in memory
corruption (as it just passed a wide string to the format specifier
expecting a narrow string), so, unfortunately, I don't think it was also
responsible for the other problems you've observed, but you will probably
still want to update to this wxWidgets commit if only to get readable
output from wx_test. And if it somehow also fixes the other problems, it
could be a nice bonus...

 Regards,
VZ

reply via email to

[Prev in Thread] Current Thread [Next in Thread]