From: Matt Kraai Date: Fri, 11 May 2001 15:16:28 +0000 (-0000) Subject: Check that putenv succeeded, suggested by Jonas Holmberg. X-Git-Tag: 0_52~205 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=eb5f433736c80ee6d3909b2803827b5d7af58bcf;p=oweals%2Fbusybox.git Check that putenv succeeded, suggested by Jonas Holmberg. --- 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);