aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-06-28 11:42:05 +0000
committerRoland McGrath <roland@gnu.org>1996-06-28 11:42:05 +0000
commitde6b062321f6631c49119190dc63b00a566148df (patch)
tree59482c6f7bc38de66b83752d144c1411cc5043c0
parent6dbe2837567f528faa015fd0cf1536201dde5ffd (diff)
downloadglibc-de6b062321f6631c49119190dc63b00a566148df.tar
glibc-de6b062321f6631c49119190dc63b00a566148df.tar.gz
glibc-de6b062321f6631c49119190dc63b00a566148df.tar.bz2
glibc-de6b062321f6631c49119190dc63b00a566148df.zip
Fri Jun 28 07:27:10 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* string/strndup.c (strndup): Always terminate the string. * string/string.h (strndupa): Likewise. Thu Jun 27 14:22:31 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * stdio/Makefile (routines): Add vscanf. * stdio-common/Makefile (routines): Remove vscanf. * stdio-common/vscanf.c: Move to ... * stdio/vscanf.c: here. * rpm/Makefile (headers, install-lib, install-lib.so, versioned, install-bin, install-sbin, install-data, install-others): Add $(-VARIABLE).
-rw-r--r--ChangeLog16
-rw-r--r--PROJECTS8
-rw-r--r--rpm/Makefile18
-rw-r--r--string/string.h7
-rw-r--r--string/strndup.c5
5 files changed, 39 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index d3ad0e0e4b..b9a6ff3054 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+Fri Jun 28 07:27:10 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
+
+ * string/strndup.c (strndup): Always terminate the string.
+ * string/string.h (strndupa): Likewise.
+
+Thu Jun 27 14:22:31 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * stdio/Makefile (routines): Add vscanf.
+ * stdio-common/Makefile (routines): Remove vscanf.
+ * stdio-common/vscanf.c: Move to ...
+ * stdio/vscanf.c: here.
+
+ * rpm/Makefile (headers, install-lib, install-lib.so,
+ versioned, install-bin, install-sbin, install-data,
+ install-others): Add $(-VARIABLE).
+
Fri Jun 28 02:41:08 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* nss/Makefile (databases): New variable.
diff --git a/PROJECTS b/PROJECTS
index 3796dff180..4c755ff8dd 100644
--- a/PROJECTS
+++ b/PROJECTS
@@ -87,7 +87,8 @@ contact <bug-glibc@prep.ai.mit.edu>
[ 9] Write AVL-tree based tsearch() et.al. functions. Currently only
a very simple algorithm is used.
-
+ There is a public domain version but using this would cause problems
+ with the assignment.
[10] Extend regex and/or rx to work with wide characters.
@@ -107,7 +108,8 @@ contact <bug-glibc@prep.ai.mit.edu>
contribute it to the FSF.
-[13] Write access function for group, ether, shadow, rpc, netmasks,
- bootparams, netgroup, publickey, automount, aliases databases.
+[13] Write access function for ether, shadow, netmasks, bootparams,
+ netgroup, publickey, automount, aliases databases for nss_files
+ and nss_db module.
The functions should be embedded in the nss scheme. This is not
hard and not all services must be supported at once.
diff --git a/rpm/Makefile b/rpm/Makefile
index 36e91b9add..148a3a19d6 100644
--- a/rpm/Makefile
+++ b/rpm/Makefile
@@ -15,15 +15,17 @@ distinfo := $(common-objpfx)distinfo- \
config = $(config-machine)-$(config-vendor)-$(config-os)
-headers := $(foreach d,$(subdirs),$($d-headers))
-install-lib := $(foreach d,$(subdirs),$($d-install-lib))
-install-lib.so := $(foreach d,$(subdirs),$(filter-out $($d-versioned),\
+headers := $(-headers) $(foreach d,$(subdirs),$($d-headers))
+install-lib := $(-install-lib) $(foreach d,$(subdirs),$($d-install-lib))
+install-lib.so := $(-install-lib.so) \
+ $(foreach d,$(subdirs),$(filter-out $($d-versioned),\
$($d-install-lib.so)))
-versioned := $(foreach d,$(subdirs),$($d-versioned))
-install-bin := $(foreach d,$(subdirs),$($d-install-bin))
-install-sbin := $(foreach d,$(subdirs),$($d-install-sbin))
-install-data := $(foreach d,$(subdirs),$($d-install-data))
-install-others := $(foreach d,$(subdirs),$($d-install-others))
+versioned := $(-versioned) $(foreach d,$(subdirs),$($d-versioned))
+install-bin := $(-install-bin) $(foreach d,$(subdirs),$($d-install-bin))
+install-sbin := $(-install-sbin) $(foreach d,$(subdirs),$($d-install-sbin))
+install-data := $(-install-data) $(foreach d,$(subdirs),$($d-install-data))
+install-others := $(-install-others) \
+ $(foreach d,$(subdirs),$($d-install-others))
# Notice things to be installed in /etc. They get specially marked as
# possibly user-modified config files.
diff --git a/string/string.h b/string/string.h
index 3b6c5e969b..7dbcc41c22 100644
--- a/string/string.h
+++ b/string/string.h
@@ -107,8 +107,11 @@ extern char *strndup __P ((__const char *__string, size_t __n));
#define strndupa(s, n) \
({ \
__const char *__old = (s); \
- size_t __len = strnlen (__old) + 1; \
- memcpy (__builtin_alloca (__len), __old, __len); \
+ char *__new; \
+ size_t __len = strnlen (__old); \
+ __new = memcpy (__builtin_alloca (__len + 1), __old, __len); \
+ __new[__len] = '\0'; \
+ __new; \
})
#endif
diff --git a/string/strndup.c b/string/strndup.c
index 213a0c056b..c40d00fc59 100644
--- a/string/strndup.c
+++ b/string/strndup.c
@@ -24,13 +24,14 @@ Cambridge, MA 02139, USA. */
char *
strndup (const char *s, size_t n)
{
- size_t len = strnlen (s) + 1;
- char *new = malloc (len);
+ size_t len = strnlen (s);
+ char *new = malloc (len + 1);
if (new == NULL)
return NULL;
memcpy (new, s, len);
+ new[len] = '\0';
return new;
}