aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coreutils/env.c3
-rw-r--r--env.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/coreutils/env.c b/coreutils/env.c
index aca7c3ae2..626fc1952 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);
diff --git a/env.c b/env.c
index aca7c3ae2..626fc1952 100644
--- a/env.c
+++ b/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);