fixed missing initialization of line variable in InitFrames() (coverity id 213)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43683 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -239,8 +239,9 @@ int wxStackWalker::InitFrames(wxStackFrame *arr, size_t n, void **addresses, cha
|
|||||||
// parse addr2line output (should be exactly 2 lines for each address)
|
// parse addr2line output (should be exactly 2 lines for each address)
|
||||||
// reusing the g_buf used for building the command line above
|
// reusing the g_buf used for building the command line above
|
||||||
wxString name, filename;
|
wxString name, filename;
|
||||||
unsigned long line, curr=0;
|
unsigned long line = 0,
|
||||||
for (size_t i=0; i<n; i++)
|
curr = 0;
|
||||||
|
for ( size_t i = 0; i < n; i++ )
|
||||||
{
|
{
|
||||||
// 1st line has function name
|
// 1st line has function name
|
||||||
if ( fgets(g_buf, WXSIZEOF(g_buf), fp) )
|
if ( fgets(g_buf, WXSIZEOF(g_buf), fp) )
|
||||||
@@ -266,10 +267,9 @@ int wxStackWalker::InitFrames(wxStackFrame *arr, size_t n, void **addresses, cha
|
|||||||
const size_t posColon = filename.find(_T(':'));
|
const size_t posColon = filename.find(_T(':'));
|
||||||
if ( posColon != wxString::npos )
|
if ( posColon != wxString::npos )
|
||||||
{
|
{
|
||||||
// parse line number
|
// parse line number (it's ok if it fails, this will just leave
|
||||||
if ( !wxString(filename, posColon + 1, wxString::npos).
|
// line at its current, invalid, 0 value)
|
||||||
ToULong(&line) )
|
wxString(filename, posColon + 1, wxString::npos).ToULong(&line);
|
||||||
line = 0;
|
|
||||||
|
|
||||||
// remove line number from 'filename'
|
// remove line number from 'filename'
|
||||||
filename.erase(posColon);
|
filename.erase(posColon);
|
||||||
|
Reference in New Issue
Block a user