libc: cleanup strchr

Move strchr to a .cpp file, and change to bionic directory.

Change-Id: I64ade7df326c0a9a714aca4caf5647b6833b1c97
This commit is contained in:
Nick Kralevich
2013-04-19 16:54:22 -07:00
parent 5e3b502b6b
commit 4f40e511b0
4 changed files with 32 additions and 17 deletions

View File

@@ -45,6 +45,15 @@ TEST(Fortify2_DeathTest, sprintf_fortified2) {
}
#if __BIONIC__
TEST(Fortify2_DeathTest, strchr_fortified2) {
::testing::FLAGS_gtest_death_test_style = "threadsafe";
foo myfoo;
memcpy(myfoo.a, "0123456789", sizeof(myfoo.a));
myfoo.b[0] = '\0';
ASSERT_EXIT(printf("%s", strchr(myfoo.a, 'a')),
testing::KilledBySignal(SIGSEGV), "");
}
TEST(Fortify2_DeathTest, strrchr_fortified2) {
::testing::FLAGS_gtest_death_test_style = "threadsafe";
foo myfoo;