From 0dbbbe9381bd53b08edff493e20d289b25933bce Mon Sep 17 00:00:00 2001 From: Jens Fischer Date: Tue, 20 Mar 2018 20:51:07 +0100 Subject: [PATCH] UTF8String: fix substr() calls with len == null, closes #1167 --- lime/text/UTF8String.hx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lime/text/UTF8String.hx b/lime/text/UTF8String.hx index c39c5973b..d96f9c451 100644 --- a/lime/text/UTF8String.hx +++ b/lime/text/UTF8String.hx @@ -174,6 +174,12 @@ abstract UTF8String(String) from String to String { **/ public function substr (pos:Int, ?len:Int):String { + if (len == null) { + + len = (this:UTF8String).length - pos; + + } + return Utf8.sub (this, pos, len); }