sbase

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

commit b914415fb4c707f99690abec91f0de21c983301b
parent 0a925debfa747bbb8a4c9ea1dfa8e960fcea8fa6
Author: sin <sin@2f30.org>
Date:   Fri Nov  6 10:51:04 +0000

env: Check unsetenv() return value

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

Diffstat:
env.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();