This is the mail archive of the
cygwin-cvs@cygwin.com
mailing list for the Cygwin project.
[newlib-cygwin] Remove redundant check for NULL pointer in cygwin_exception::dump_exception
- From: Corinna Vinschen <corinna at sourceware dot org>
- To: cygwin-cvs at sourceware dot org
- Date: 24 Nov 2016 13:47:05 -0000
- Subject: [newlib-cygwin] Remove redundant check for NULL pointer in cygwin_exception::dump_exception
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=6a6ae087e8ee3645d2ce4d8c45735842eadf9a93
commit 6a6ae087e8ee3645d2ce4d8c45735842eadf9a93
Author: Corinna Vinschen <corinna@vinschen.de>
Date: Thu Nov 24 14:46:57 2016 +0100
Remove redundant check for NULL pointer in cygwin_exception::dump_exception
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diff:
---
winsup/cygwin/exceptions.cc | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 0f5a890..743c732 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -175,15 +175,12 @@ cygwin_exception::dump_exception ()
{
const char *exception_name = NULL;
- if (e)
+ for (int i = 0; status_info[i].name; i++)
{
- for (int i = 0; status_info[i].name; i++)
+ if (status_info[i].code == (NTSTATUS) e->ExceptionCode)
{
- if (status_info[i].code == (NTSTATUS) e->ExceptionCode)
- {
- exception_name = status_info[i].name;
- break;
- }
+ exception_name = status_info[i].name;
+ break;
}
}