diff options
author | Caolán McNamara <caolanm@redhat.com> | 2010-12-09 12:07:45 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2010-12-09 12:07:45 +0000 |
commit | 3d86e3f51a102fded009a70f32f3f75617c9452c (patch) | |
tree | 437be71741bc32750af459f0cf050871e7f610c1 /sal | |
parent | 3358b4f31190b02a350da6a56e54d8e3fb306b9e (diff) |
cppcheck: scope of these variables can be reduced
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/backtrace.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sal/osl/unx/backtrace.c b/sal/osl/unx/backtrace.c index 7787ee997c52..7d3c0c55c3f9 100644 --- a/sal/osl/unx/backtrace.c +++ b/sal/osl/unx/backtrace.c @@ -268,10 +268,11 @@ void backtrace_symbols_fd( void **buffer, int size, int fd ) for ( pFramePtr = buffer; size > 0 && pFramePtr && *pFramePtr; pFramePtr++, size-- ) { Dl_info dli; - ptrdiff_t offset; if ( 0 != dladdr( *pFramePtr, &dli ) ) { + ptrdiff_t offset; + if ( dli.dli_fname && dli.dli_fbase ) { offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_fbase; @@ -334,10 +335,11 @@ void backtrace_symbols_fd( void **buffer, int size, int fd ) for ( pFramePtr = buffer; size > 0 && pFramePtr && *pFramePtr; pFramePtr++, size-- ) { Dl_info dli; - ptrdiff_t offset; if ( 0 != dladdr( *pFramePtr, &dli ) ) { + ptrdiff_t offset; + if ( dli.dli_fname && dli.dli_fbase ) { offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_fbase; |