1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

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).
This commit is contained in:
Roland McGrath
1996-06-28 11:42:05 +00:00
parent 6dbe283756
commit de6b062321
5 changed files with 39 additions and 15 deletions

View File

@ -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