summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorMatt Kraai2001-05-11 15:16:28 +0000
committerMatt Kraai2001-05-11 15:16:28 +0000
commiteb5f433736c80ee6d3909b2803827b5d7af58bcf (patch)
treef4de688a2b8f96cbc625364bd7c94560b5db097e /coreutils
parentc96381be40f1fd56f9eca11f43be7a10865c1881 (diff)
downloadbusybox-eb5f433736c80ee6d3909b2803827b5d7af58bcf.zip
busybox-eb5f433736c80ee6d3909b2803827b5d7af58bcf.tar.gz
Check that putenv succeeded, suggested by Jonas Holmberg.
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/env.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/coreutils/env.c b/coreutils/env.c
index aca7c3a..626fc19 100644
--- a/coreutils/env.c
+++ b/coreutils/env.c
@@ -59,7 +59,8 @@ extern int env_main(int argc, char** argv)
cleanenv[0] = NULL;
}
for (argv += optind; *argv && (p = strchr(*argv, '=')); ++argv)
- putenv(*argv);
+ if (putenv(*argv) < 0)
+ perror_msg_and_die("%s", *argv);
if (*argv) {
execvp(*argv, argv);
perror_msg_and_die("%s", *argv);