public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Siddhesh Poyarekar <siddhesh@sourceware.org>
To: libc-alpha@sourceware.org
Subject: [PATCH] tests: Remove NULL check for an array
Date: Wed, 11 Nov 2020 22:59:13 +0530	[thread overview]
Message-ID: <20201111172913.890166-1-siddhesh@sourceware.org> (raw)

The NULL check for an array on stack is pointless since it will always
be false, so drop it.
---

This is fairly obvious, so I'll commit it in a day if nobody objects.

Siddhesh

 stdio-common/scanf14.c | 2 --
 stdio-common/scanf15.c | 2 --
 stdio-common/scanf16.c | 2 --
 stdio-common/scanf17.c | 2 --
 4 files changed, 8 deletions(-)

diff --git a/stdio-common/scanf14.c b/stdio-common/scanf14.c
index f92838edd2..4c2feea7ba 100644
--- a/stdio-common/scanf14.c
+++ b/stdio-common/scanf14.c
@@ -86,8 +86,6 @@ main (void)
 
   char fname[strlen (tmpdir) + sizeof "/tst-scanf14.XXXXXX"];
   sprintf (fname, "%s/tst-scanf14.XXXXXX", tmpdir);
-  if (fname == NULL)
-    FAIL ();
 
   /* Create a temporary file.   */
   int fd = mkstemp (fname);
diff --git a/stdio-common/scanf15.c b/stdio-common/scanf15.c
index a937815b14..6e4980c2e1 100644
--- a/stdio-common/scanf15.c
+++ b/stdio-common/scanf15.c
@@ -69,8 +69,6 @@ main (void)
 
   char fname[strlen (tmpdir) + sizeof "/tst-scanf15.XXXXXX"];
   sprintf (fname, "%s/tst-scanf15.XXXXXX", tmpdir);
-  if (fname == NULL)
-    FAIL ();
 
   /* Create a temporary file.   */
   int fd = mkstemp (fname);
diff --git a/stdio-common/scanf16.c b/stdio-common/scanf16.c
index b4ba3e6fe3..073a77efbe 100644
--- a/stdio-common/scanf16.c
+++ b/stdio-common/scanf16.c
@@ -117,8 +117,6 @@ main (void)
 
   char fname[strlen (tmpdir) + sizeof "/tst-scanf16.XXXXXX"];
   sprintf (fname, "%s/tst-scanf16.XXXXXX", tmpdir);
-  if (fname == NULL)
-    FAIL ();
 
   /* Create a temporary file.   */
   int fd = mkstemp (fname);
diff --git a/stdio-common/scanf17.c b/stdio-common/scanf17.c
index 428f22e45c..3224573733 100644
--- a/stdio-common/scanf17.c
+++ b/stdio-common/scanf17.c
@@ -100,8 +100,6 @@ main (void)
 
   char fname[strlen (tmpdir) + sizeof "/tst-scanf17.XXXXXX"];
   sprintf (fname, "%s/tst-scanf17.XXXXXX", tmpdir);
-  if (fname == NULL)
-    FAIL ();
 
   /* Create a temporary file.   */
   int fd = mkstemp (fname);
-- 
2.26.2


             reply	other threads:[~2020-11-11 17:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-11 17:29 Siddhesh Poyarekar [this message]
2020-11-12  8:01 ` Siddhesh Poyarekar

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=20201111172913.890166-1-siddhesh@sourceware.org \
    --to=siddhesh@sourceware.org \
    --cc=libc-alpha@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).