summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXuefer <xuefer@gmail.com>2015-04-16 20:01:32 +0200
committerDees Troy <dees_troy@teamw.in>2015-06-04 18:44:34 +0200
commit0eb2aab0583d6443865337b0a42b18cee233f494 (patch)
tree72ecc12f9e73a2d4b5e655d0f437a4818e5620e9
parentgui: set tw_file to the currently flashed file name without path (diff)
downloadandroid_bootable_recovery-0eb2aab0583d6443865337b0a42b18cee233f494.tar
android_bootable_recovery-0eb2aab0583d6443865337b0a42b18cee233f494.tar.gz
android_bootable_recovery-0eb2aab0583d6443865337b0a42b18cee233f494.tar.bz2
android_bootable_recovery-0eb2aab0583d6443865337b0a42b18cee233f494.tar.lz
android_bootable_recovery-0eb2aab0583d6443865337b0a42b18cee233f494.tar.xz
android_bootable_recovery-0eb2aab0583d6443865337b0a42b18cee233f494.tar.zst
android_bootable_recovery-0eb2aab0583d6443865337b0a42b18cee233f494.zip
-rw-r--r--minuitwrp/truetype.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/minuitwrp/truetype.c b/minuitwrp/truetype.c
index a286449ed..8f62ff26b 100644
--- a/minuitwrp/truetype.c
+++ b/minuitwrp/truetype.c
@@ -120,9 +120,6 @@ static inline uint32_t fnv_hash_add(uint32_t cur_hash, uint32_t word)
int utf8_to_unicode(unsigned char* pIn, unsigned int *pOut)
{
- if(pIn == NULL || pOut == NULL)
- return 0;
-
int utf_bytes = 1;
unsigned int unicode = 0;
unsigned char tmp;
@@ -139,7 +136,11 @@ int utf8_to_unicode(unsigned char* pIn, unsigned int *pOut)
while((tmp & 0xC0) == 0xC0)
{
utf_bytes ++;
- if(utf_bytes > 6) return 0;
+ if(utf_bytes > 6)
+ {
+ *pOut = tmp;
+ return 1;
+ }
tmp = 0xFF & (tmp << 1);
total_bits += 6;
high_bit_mask >>= 1;