about summary refs log tree commit diff
path: root/sysdeps/generic/putenv.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-05-14 19:14:48 +0000
committerUlrich Drepper <drepper@redhat.com>1998-05-14 19:14:48 +0000
commitff152e3fc8c7d38e08d9f9d70eb6109c878e1372 (patch)
tree7fc3fb83b20673816f3f2082ac79558028f02b25 /sysdeps/generic/putenv.c
parent847a35a07b6412a24f8978cf2a7fafc4e5c4a471 (diff)
downloadglibc-ff152e3fc8c7d38e08d9f9d70eb6109c878e1372.tar.gz
glibc-ff152e3fc8c7d38e08d9f9d70eb6109c878e1372.tar.xz
glibc-ff152e3fc8c7d38e08d9f9d70eb6109c878e1372.zip
Update.
1998-05-14 13:25  Ulrich Drepper  <drepper@cygnus.com>

	* inet/netinet/in.h: Add defines for multicast.
	Reported by Jeremy Hall <jhall@UU.NET>.

	* stdlib/stdlib.h: Add prototypes for __setenv and __unsetenv.
	* sysdeps/generic/putenv.c: Use __setenv and __unsetenv, not setenv
	and unsetenv.  Optimize _LIBC case.
	* sysdeps/generic/setenv.c: Prevent unnecessary memory leaks.
	Define functions with leading __.

	* time/tzfile.c: Correct handling of global variables daylight,
	timezone, and tzname.
	* time/tzset.c: Likewise.
	* timezone/Makefile (tests): Add tst-timezone.
	* timezone/tst-timezone.c: New file.

1998-05-14 10:35  Ulrich Drepper  <drepper@cygnus.com>

	* timezone/asia: Update from tzdata1998d.
	* timezone/australasia: Likewise.
	* timezone/europe: Likewise.
Diffstat (limited to 'sysdeps/generic/putenv.c')
-rw-r--r--sysdeps/generic/putenv.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sysdeps/generic/putenv.c b/sysdeps/generic/putenv.c
index 296f2847cf..d059c2f78c 100644
--- a/sysdeps/generic/putenv.c
+++ b/sysdeps/generic/putenv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#if defined (_AIX) && !defined (__GNUC__)
+#if defined _AIX && !defined __GNUC__
  #pragma alloca
 #endif
 
@@ -45,6 +45,9 @@
 extern char *alloca ();
 #  endif /* __GNUC__ */
 # endif /* HAVE_ALLOCA_H */
+
+# define setenv __setenv
+# define unsetenv __unsetenv
 #endif /* _LIBC */
 
 
@@ -57,10 +60,10 @@ putenv (string)
 
   if (name_end != NULL)
     {
-      char *name = alloca (name_end - string + 1);
 #ifdef _LIBC
-      *((char *) __mempcpy (name, string, name_end - string)) = '\0';
+      char *name = strndupa (string, name_end - string);
 #else
+      char *name = alloca (name_end - string + 1);
       memcpy (name, string, name_end - string);
       name[name_end - string] = '\0';
 #endif