sbase

suckless unix tools
git clone git://git.2f30.org/sbase
Log | Files | Refs | README | LICENSE

commit b553349251e3904601f4c535e2f5b0911450da88
parent 1b32732887b575a553cdbe07555ab9526a716e00
Author: sin <sin@2f30.org>
Date:   Fri,  6 Nov 2015 10:51:04 +0000

env: Check unsetenv() return value

./env -u "" foo and ./env -u "A=123" foo should both fail.

Diffstat:
Menv.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 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();