commit b553349251e3904601f4c535e2f5b0911450da88
Author:     sin <[email protected]>
AuthorDate: Fri Nov 6 10:51:04 2015 +0000
Commit:     sin <[email protected]>
CommitDate: Fri Nov 6 10:52:49 2015 +0000

    env: Check unsetenv() return value
    
    ./env -u "" foo and ./env -u "A=123" foo should both fail.

diff --git a/env.c b/env.c
index 4da2630..5d7e8a5 100644
--- a/env.c
+++ b/env.c
@@ -25,7 +25,8 @@ main(int argc, char *argv[])
                *environ = NULL;
                break;
        case 'u':
-               unsetenv(EARGF(usage()));
+               if (unsetenv(EARGF(usage())) < 0)
+                       eprintf("unsetenv:");
                break;
        default:
                usage();

Reply via email to