diff options
author | inmarket <andrewh@inmarket.com.au> | 2018-03-10 20:36:35 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2018-03-10 20:36:35 +1000 |
commit | 0771c148171b8cb6235086402275a4e82d3ea342 (patch) | |
tree | 74313a4d468a92f5510d23a6c35a3c95bfce8e86 /src/gdisp | |
parent | 94f1cc2f0a4db0c6f1483e6d648068e031bcc094 (diff) | |
parent | bee02d5bb58800104a6dd7490ec2424dacecf625 (diff) | |
download | uGFX-0771c148171b8cb6235086402275a4e82d3ea342.tar.gz uGFX-0771c148171b8cb6235086402275a4e82d3ea342.tar.bz2 uGFX-0771c148171b8cb6235086402275a4e82d3ea342.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src/gdisp')
-rw-r--r-- | src/gdisp/mcufont/mf_wordwrap.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gdisp/mcufont/mf_wordwrap.c b/src/gdisp/mcufont/mf_wordwrap.c index 6403722d..de684ca1 100644 --- a/src/gdisp/mcufont/mf_wordwrap.c +++ b/src/gdisp/mcufont/mf_wordwrap.c @@ -179,6 +179,7 @@ void mf_wordwrap(const struct mf_font_s *font, int16_t width, struct linelen_s current = { 0 }; struct linelen_s previous = { 0 }; bool full; + uint32_t giveUp = 2048; /* Do while-loop a maximum of x times */ current.start = text; @@ -214,6 +215,12 @@ void mf_wordwrap(const struct mf_font_s *font, int16_t width, current.last_word.space = 0; current.last_word.chars = 0; } + + giveUp--; + if (giveUp == 0) + { + break; + } } /* Dispatch the last lines. */ |