From 2e35d8c8e1c4a2f5b17eb3afa91ce1de7a1ab9e5 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 23 Sep 2002 04:13:42 +0000 Subject: unnecessary with stratcliff --- string/Makefile | 2 +- string/bug-stpncpy-offend.c | 53 --------------------------------------------- 2 files changed, 1 insertion(+), 54 deletions(-) delete mode 100644 string/bug-stpncpy-offend.c (limited to 'string') diff --git a/string/Makefile b/string/Makefile index b0f5571..eed07fc 100644 --- a/string/Makefile +++ b/string/Makefile @@ -48,7 +48,7 @@ o-objects.ob := memcpy.o memset.o memchr.o tests := tester inl-tester noinl-tester testcopy test-ffs \ tst-strlen stratcliff tst-svc tst-inlcall \ bug-strncat1 bug-strspn1 bug-strpbrk1 tst-bswap \ - tst-strtok tst-strxfrm bug-strcoll1 bug-stpncpy-offend + tst-strtok tst-strxfrm bug-strcoll1 distribute := memcopy.h pagecopy.h tst-svc.expect diff --git a/string/bug-stpncpy-offend.c b/string/bug-stpncpy-offend.c deleted file mode 100644 index 3a782f7..0000000 --- a/string/bug-stpncpy-offend.c +++ /dev/null @@ -1,53 +0,0 @@ -/* Test program for stpncpy reading off the end of the source string. */ - -#include -#include -#include - -static int do_test (void); -#define TEST_FUNCTION do_test () -#include - -static int -do_test (void) -{ - /* We get two pages of memory and then protect the second one so - we are sure to fault if we access past the end of the first page. - Then we test the odd-size string ending just on the page boundary. */ - - static const char test_string[] = "Seven."; - const size_t pagesz = getpagesize (); - char *buf = mmap (NULL, pagesz * 2, - PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0); - char *s1, *r; - volatile size_t len = sizeof test_string; - - if (buf == MAP_FAILED) - { - perror ("mmap"); - return 1; - } - if (mprotect (buf + pagesz, pagesz, PROT_NONE) != 0) - { - perror ("mprotect"); - return 2; - } - - s1 = buf + pagesz - sizeof test_string; - memcpy (s1, test_string, sizeof test_string); - - r = stpncpy (buf, s1, len); - if (r != buf + len - 1) - { - printf ("r = buf + %d != %zu\n", r - buf, len - 1); - return 3; - } - r = stpncpy (s1, buf, len); - if (r != s1 + len - 1) - { - printf ("r = s1 + %d != %zu\n", r - s1, len - 1); - return 3; - } - - return 0; -} -- cgit v1.1