env: Check unsetenv() return value

./env -u "" foo and ./env -u "A=123" foo should both fail.
master
sin 7 years ago
parent 1b32732887
commit b553349251

@ -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();

Loading…
Cancel
Save