Loading libcutils/strdup16to8.c +6 −3 Original line number Diff line number Diff line Loading @@ -55,7 +55,8 @@ extern size_t strnlen16to8(const char16_t* utf16Str, size_t len) /* Fast path for the usual case where 3*len is < SIZE_MAX-1. */ if (len < (SIZE_MAX-1)/3) { while (len--) { while (len != 0) { len--; unsigned int uic = *utf16Str++; if (uic > 0x07ff) Loading @@ -69,7 +70,8 @@ extern size_t strnlen16to8(const char16_t* utf16Str, size_t len) } /* The slower but paranoid version */ while (len--) { while (len != 0) { len--; unsigned int uic = *utf16Str++; size_t utf8Cur = utf8Len; Loading Loading @@ -112,7 +114,8 @@ extern char* strncpy16to8(char* utf8Str, const char16_t* utf16Str, size_t len) * strnlen16to8() properly or at a minimum checked the result of * its malloc(SIZE_MAX) in case of overflow. */ while (len--) { while (len != 0) { len--; unsigned int uic = *utf16Str++; if (uic > 0x07ff) { Loading Loading
libcutils/strdup16to8.c +6 −3 Original line number Diff line number Diff line Loading @@ -55,7 +55,8 @@ extern size_t strnlen16to8(const char16_t* utf16Str, size_t len) /* Fast path for the usual case where 3*len is < SIZE_MAX-1. */ if (len < (SIZE_MAX-1)/3) { while (len--) { while (len != 0) { len--; unsigned int uic = *utf16Str++; if (uic > 0x07ff) Loading @@ -69,7 +70,8 @@ extern size_t strnlen16to8(const char16_t* utf16Str, size_t len) } /* The slower but paranoid version */ while (len--) { while (len != 0) { len--; unsigned int uic = *utf16Str++; size_t utf8Cur = utf8Len; Loading Loading @@ -112,7 +114,8 @@ extern char* strncpy16to8(char* utf8Str, const char16_t* utf16Str, size_t len) * strnlen16to8() properly or at a minimum checked the result of * its malloc(SIZE_MAX) in case of overflow. */ while (len--) { while (len != 0) { len--; unsigned int uic = *utf16Str++; if (uic > 0x07ff) { Loading