mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
Update.
2001-11-02 Jakub Jelinek <jakub@redhat.com> * string/bits/string2.h (__strndup): If n is smaller than len, set len to n + 1. * string/tester.c (test_strndup): New function. (main): Call it. * sunrpc/rpc_main.c: Optimize variable definitions a bit.
This commit is contained in:
@ -1216,7 +1216,7 @@ extern char *__strndup (__const char *__string, size_t __n)
|
||||
size_t __n = (n); \
|
||||
char *__retval; \
|
||||
if (__n < __len) \
|
||||
__len = __n; \
|
||||
__len = __n + 1; \
|
||||
__retval = (char *) malloc (__len); \
|
||||
if (__retval != NULL) \
|
||||
{ \
|
||||
|
Reference in New Issue
Block a user