1
0
Fork 0
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:
Jens Arnold 2007-09-05 06:48:33 +00:00
parent fcab061250
commit af533820ee

View file

@ -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 {