From 2facd9df6cf3d937069a5700977133ad3d499d4c Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Thu, 22 Nov 2018 18:58:41 +0100 Subject: [PATCH] Fix endless loop and resulting OOM when RTL support is enabled and a word is exactly the configured max line length This should be reviewed by the original author And could be connected to #1311 --- .../nodomain/freeyourgadget/gadgetbridge/util/RtlUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/RtlUtils.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/RtlUtils.java index d76eabf6d..d01df1587 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/RtlUtils.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/RtlUtils.java @@ -527,7 +527,7 @@ public class RtlUtils { do { if ((line.length() + phrase.length() + word.length() < line_max_size) || - (line.length() == 0 && word.length() > line_max_size)) { + (line.length() == 0 && word.length() >= line_max_size)) { if (isSpaceSign(c)) { word.append(c); addCharToWord = true;