public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Joel Sherrill <joel@rtems.org>
To: newlib@sourceware.org
Cc: Joel Sherrill <joel@rtems.org>
Subject: [PATCH 2/2] libc/string/strsignal.c: Use of || not && lead to dead code.
Date: Wed, 15 Mar 2017 17:41:00 -0000	[thread overview]
Message-ID: <1489599679-1519-2-git-send-email-joel@rtems.org> (raw)
In-Reply-To: <1489599679-1519-1-git-send-email-joel@rtems.org>

Coverity Id: 175333
---
 newlib/libc/string/strsignal.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/newlib/libc/string/strsignal.c b/newlib/libc/string/strsignal.c
index 94ae26d..e32c9a7 100644
--- a/newlib/libc/string/strsignal.c
+++ b/newlib/libc/string/strsignal.c
@@ -37,7 +37,7 @@ QUICKREF
 /*
  *  Written by Joel Sherrill <joel.sherrill@OARcorp.com>.
  *
- *  COPYRIGHT (c) 2010.
+ *  COPYRIGHT (c) 2010, 2017.
  *  On-Line Applications Research Corporation (OAR).
  *
  *  Permission to use, copy, modify, and distribute this software for any
@@ -49,8 +49,6 @@ QUICKREF
  *  WARRANTY.  IN PARTICULAR,  THE AUTHOR MAKES NO REPRESENTATION
  *  OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS
  *  SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
- *
- *  $Id$
  */
 
 #include <string.h>
@@ -72,7 +70,7 @@ _DEFUN (strsignal, (signal),
   buffer = _REENT_SIGNAL_BUF(ptr);
 
 #if defined(SIGRTMIN) && defined(SIGRTMAX)
-  if ((signal >= SIGRTMIN) || (signal <= SIGRTMAX)) {
+  if ((signal >= SIGRTMIN) && (signal <= SIGRTMAX)) {
     siprintf (buffer, "Real-time signal %d", signal - SIGRTMIN);
     return buffer;
   }
-- 
1.8.3.1

      reply	other threads:[~2017-03-15 17:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-15 17:41 [PATCH 1/2] rtems/crt0.c: getentropy() stub did not return a value Joel Sherrill
2017-03-15 17:41 ` Joel Sherrill [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1489599679-1519-2-git-send-email-joel@rtems.org \
    --to=joel@rtems.org \
    --cc=newlib@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).