diff options
author | Ulrich Drepper <drepper@redhat.com> | 2001-11-03 09:05:11 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2001-11-03 09:05:11 +0000 |
commit | fb4fb5428d50d3d0c092a60f5ef4410f250ed2c4 (patch) | |
tree | 5729b64ff57a4aa16283a7f2904c7acba8fca711 /string/bits | |
parent | 5f73e77144a76a585f108c971e6c7aa5c9008944 (diff) | |
download | glibc-fb4fb5428d50d3d0c092a60f5ef4410f250ed2c4.zip glibc-fb4fb5428d50d3d0c092a60f5ef4410f250ed2c4.tar.gz glibc-fb4fb5428d50d3d0c092a60f5ef4410f250ed2c4.tar.bz2 |
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.
Diffstat (limited to 'string/bits')
-rw-r--r-- | string/bits/string2.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/string/bits/string2.h b/string/bits/string2.h index aafb578..e8ac063 100644 --- a/string/bits/string2.h +++ b/string/bits/string2.h @@ -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) \ { \ |