Merge "Fix strstr16." into nyc-dev

am: a34a383607

* commit 'a34a383607007d632878929c6c9278221242d457':
  Fix strstr16.

Change-Id: Ia41d8da5d627ac1e28f2fe7b02c7e9a740727556
This commit is contained in:
Michael Wright 2016-05-17 17:27:56 +00:00 committed by android-build-merger
commit a12fb416d7
1 changed files with 2 additions and 1 deletions

View File

@ -292,6 +292,7 @@ size_t strnlen16(const char16_t *s, size_t maxlen)
char16_t* strstr16(const char16_t* src, const char16_t* target)
{
const char16_t needle = *target++;
const size_t target_len = strlen16(target);
if (needle != '\0') {
do {
do {
@ -299,7 +300,7 @@ char16_t* strstr16(const char16_t* src, const char16_t* target)
return nullptr;
}
} while (*src++ != needle);
} while (strcmp16(src, target) != 0);
} while (strncmp16(src, target, target_len) != 0);
src--;
}