[hackers] [sbase] env: environ can never be NULL so don't check for it || sin

From: <git_AT_suckless.org>
Date: Fri, 6 Nov 2015 11:52:53 +0100 (CET)

commit 1b32732887b575a553cdbe07555ab9526a716e00
Author: sin <sin_AT_2f30.org>
AuthorDate: Fri Nov 6 10:48:52 2015 +0000
Commit: sin <sin_AT_2f30.org>
CommitDate: Fri Nov 6 10:52:49 2015 +0000

    env: environ can never be NULL so don't check for it

diff --git a/env.c b/env.c
index d58f2dd..4da2630 100644
--- a/env.c
+++ b/env.c
_AT_@ -22,8 +22,7 @@ main(int argc, char *argv[])
 
         ARGBEGIN {
         case 'i':
- if (environ)
- *environ = NULL;
+ *environ = NULL;
                 break;
         case 'u':
                 unsetenv(EARGF(usage()));
_AT_@ -42,7 +41,7 @@ main(int argc, char *argv[])
                 _exit(126 + (savederrno == ENOENT));
         }
 
- for (; environ && *environ; environ++)
+ for (; *environ; environ++)
                 puts(*environ);
 
         return fshut(stdout, "<stdout>");
Received on Fri Nov 06 2015 - 11:52:53 CET

This archive was generated by hypermail 2.3.0 : Fri Nov 06 2015 - 12:00:19 CET