forked from len0rd/rockbox
More efficient version of the fix.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14619 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
fcab061250
commit
af533820ee
1 changed files with 3 additions and 4 deletions
|
@ -512,13 +512,12 @@ static int unicode_len(char encoding, const void* string)
|
|||
int len = 0;
|
||||
|
||||
if (encoding == 0x01 || encoding == 0x02) {
|
||||
bool iswchar;
|
||||
char first;
|
||||
const char *s = string;
|
||||
/* string might be unaligned, so using short* can crash on ARM and SH1 */
|
||||
do {
|
||||
iswchar = (*s++ != 0);
|
||||
iswchar |= (*s++ != 0);
|
||||
} while (iswchar);
|
||||
first = *s++;
|
||||
} while ((first | *s++) != 0);
|
||||
|
||||
len = s - (const char*) string;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue