OSDN Git Service
(root)
/
android-x86
/
external-exfat.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Add function that calculates UTF-16 string length.
[android-x86/external-exfat.git]
/
libexfat
/
utf.c
diff --git
a/libexfat/utf.c
b/libexfat/utf.c
index
6465661
..
8598d70
100644
(file)
--- a/
libexfat/utf.c
+++ b/
libexfat/utf.c
@@
-211,3
+211,12
@@
int utf8_to_utf16(le16_t* output, const char* input, size_t outsize,
*outp = cpu_to_le16(0);
return 0;
}
+
+size_t utf16_length(const le16_t* str)
+{
+ size_t i = 0;
+
+ while (le16_to_cpu(str[i]))
+ i++;
+ return i;
+}