diff --git a/src/unix/stackwalk.cpp b/src/unix/stackwalk.cpp index c30c44d762..2d8e5097f1 100644 --- a/src/unix/stackwalk.cpp +++ b/src/unix/stackwalk.cpp @@ -286,18 +286,18 @@ int wxStackWalker::InitFrames(wxStackFrame *arr, size_t n, void **addresses, cha // func(args) (in module) (file:line) // // or just the same address back if it couldn't be resolved. - const size_t posIn = buffer.find("(in "); + const size_t posIn = buffer.find(" (in "); if ( posIn != wxString::npos ) { name.assign(buffer, 0, posIn); - size_t posAt = buffer.find(") (", posIn + 3); + size_t posAt = buffer.find(") (", posIn + 5); // Skip " (in " if ( posAt != wxString::npos ) { posAt += 3; // Skip ") (" - // Discard the two last characters which are ")\n" - wxString location(buffer, posAt, buffer.length() - posAt - 2); + // Discard the last character which is ")" + wxString location(buffer, posAt, buffer.length() - posAt - 1); wxString linenum; filename = location.BeforeFirst(':', &linenum);