diff --git a/apps/gui/splash.c b/apps/gui/splash.c index d0f1fbb67c..e8ad591264 100644 --- a/apps/gui/splash.c +++ b/apps/gui/splash.c @@ -90,6 +90,18 @@ static bool splash_internal(struct screen * screen, const char *fmt, va_list ap, break; /* screen full or out of lines */ x = 0; y += chr_h; + + /* split when it fits since we didn't find a valid token to break on */ + size_t nl = next_len; + while (w > vp->width && --nl > 0) + w = font_getstringnsize(next, nl, NULL, NULL, fontnum); + + if (nl > 1 && nl != next_len) + { + next_len = nl; + store = next + nl; /* move the start pos for the next token read */ + } + lines[++line].len = next_len; lines[line].str = next; }