From: Ondřej Bílka Date: Mon, 10 Feb 2014 13:22:31 +0000 (+0100) Subject: Fix previous commit. X-Git-Tag: glibc-2.20~891 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1448f3244714a9dabb5240ec18b094f100887d5c;p=platform%2Fupstream%2Fglibc.git Fix previous commit. --- diff --git a/stdlib/setenv.c b/stdlib/setenv.c index 3043498..6b5f9be 100644 --- a/stdlib/setenv.c +++ b/stdlib/setenv.c @@ -146,6 +146,11 @@ __add_to_environ (name, value, combined, replace) UNLOCK; return -1; } + + if (__environ != last_environ) + memcpy ((char *) new_environ, (char *) __environ, + size * sizeof (char *)); + new_environ[size] = NULL; new_environ[size + 1] = NULL; ep = new_environ + size;