summaryrefslogtreecommitdiff
path: root/symbian
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-03-19 15:38:06 -0600
committerKarl Williamson <public@khwilliamson.com>2012-03-19 18:23:44 -0600
commit4b88fb76efce8c436e63b907c9842345d4fa77c7 (patch)
tree67d8be3146bf0c32e93bd8209c141ed72c5a0ae2 /symbian
parent27d6c58a7e12243bef66c58b38e7d1415d9ca07e (diff)
downloadperl-4b88fb76efce8c436e63b907c9842345d4fa77c7.tar.gz
Use the new utf8 to code point functions
These functions should be used in preference to the old ones which can read beyond the end of the input string.
Diffstat (limited to 'symbian')
-rw-r--r--symbian/PerlBase.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/symbian/PerlBase.cpp b/symbian/PerlBase.cpp
index 4162e57759..9312abeb55 100644
--- a/symbian/PerlBase.cpp
+++ b/symbian/PerlBase.cpp
@@ -364,7 +364,9 @@ int CPerlBase::ConsoleRead(const int fd, char* buf, int n)
#else
dTHX;
for (i = 0; i < nUtf8; i+= UTF8SKIP(pUtf8 + i)) {
- unsigned long u = utf8_to_uvchr((U8*)(pUtf8 + i), 0);
+ unsigned long u = utf8_to_uvchr_buf((U8*)(pUtf8 + i),
+ (U8*)(pUtf8 + nUtf8),
+ 0);
if (u > 0xFF) {
iConsole->Printf(_L("(keycode > 0xFF)\n"));
buf[i] = 0;
@@ -401,7 +403,7 @@ int CPerlBase::ConsoleWrite(const int fd, const char* buf, int n)
dTHX;
if (is_utf8_string((U8*)buf, n)) {
for (int i = 0; i < n; i += UTF8SKIP(buf + i)) {
- TChar u = utf8_to_uvchr((U8*)(buf + i), 0);
+ TChar u = valid_utf8_to_uvchr((U8*)(buf + i), 0);
iConsole->Printf(_L("%c"), u);
wrote++;
}