aboutsummaryrefslogtreecommitdiff
path: root/string/test-strncmp.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-11-09 00:36:21 +0000
committerRoland McGrath <roland@gnu.org>2002-11-09 00:36:21 +0000
commit9372c9582451c4d40152769a0aeba35e58942b59 (patch)
tree1432bae1710df677dde7bdc95bb8057fbd6b3449 /string/test-strncmp.c
parent2b49744308c65a95862b4ae197f27cec3ae8beaa (diff)
downloadglibc-9372c9582451c4d40152769a0aeba35e58942b59.tar
glibc-9372c9582451c4d40152769a0aeba35e58942b59.tar.gz
glibc-9372c9582451c4d40152769a0aeba35e58942b59.tar.bz2
glibc-9372c9582451c4d40152769a0aeba35e58942b59.zip
* string/test-strspn.c (do_test): Ensure zero termination.
* string/test-strpbrk.c (do_test): Likewise. * string/test-strncmp.c (stupid_strncmp): Use strnlen, not strlen. * string/test-strncpy.c (stupid_strncpy): Likewise. * string/test-stpncpy.c (stupid_stpncpy): Likewise. 2002-10-08 Roland McGrath <roland@redhat.com> * string/test-string.h (test_init): Fill BUF1 and BUF2 with nonzero characters. 2002-09-22 H.J. Lu <hjl@gnu.org> * sysdeps/unix/sysv/linux/mmap64.c (MMAP2_PAGE_SHIFT): Renamed from PAGE_SHIFT. Define if not defined. Check MMAP2_PAGE_SHIFT only if __NR_mmap2 is defined. * sysdeps/unix/sysv/linux/powerpc/mmap64.c: Moved to ... * sysdeps/unix/sysv/linux/mmap64.c: ... here. * sysdeps/unix/sysv/linux/hppa/mmap64.c: File removed. * sysdeps/unix/sysv/linux/sparc/sparc32/mmap64.c: FIle removed,
Diffstat (limited to 'string/test-strncmp.c')
-rw-r--r--string/test-strncmp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string/test-strncmp.c b/string/test-strncmp.c
index 8881909646..2c49e576d6 100644
--- a/string/test-strncmp.c
+++ b/string/test-strncmp.c
@@ -42,7 +42,7 @@ simple_strncmp (const char *s1, const char *s2, size_t n)
int
stupid_strncmp (const char *s1, const char *s2, size_t n)
{
- size_t ns1 = strlen (s1) + 1, ns2 = strlen (s2) + 1;
+ size_t ns1 = strnlen (s1, n) + 1, ns2 = strnlen (s2, n) + 1;
int ret = 0;
n = ns1 < n ? ns1 : n;