From 1054b5748ca2ad1fd598bb95312112f6568cb1dd Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Wed, 25 Jul 2018 20:41:41 +0200 Subject: Revert "Ignore truncation in lcd-scroll.c" This reverts commit 540637ed3334364fe9d1b54cdc96a52f59afda83. Change-Id: I88e71ef47a11818a5acb407ff9c0723d3c197243 --- firmware/drivers/lcd-scroll.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'firmware/drivers') diff --git a/firmware/drivers/lcd-scroll.c b/firmware/drivers/lcd-scroll.c index dd6a6fe8cb..0e17303bd3 100644 --- a/firmware/drivers/lcd-scroll.c +++ b/firmware/drivers/lcd-scroll.c @@ -140,7 +140,6 @@ void LCDFN(jump_scroll_delay)(int ms) * Returns true if the text scrolled to the end */ bool LCDFN(scroll_now)(struct scrollinfo *s) { - int len; int width = LCDFN(getstringsize)(s->linebuffer, NULL, NULL); bool ended = false; /* assume s->scroll_func() don't yield; otherwise this buffer might need @@ -165,12 +164,8 @@ bool LCDFN(scroll_now)(struct scrollinfo *s) } else { - len = snprintf(line_buf, sizeof(line_buf)-1, "%s%s%s", - s->linebuffer, " ", s->linebuffer); - - if ((unsigned) len > sizeof(line_buf)) - do { } while (0); /* ignore truncation */ - + snprintf(line_buf, sizeof(line_buf)-1, "%s%s%s", + s->linebuffer, " ", s->linebuffer); s->line = line_buf; width += LCDFN(getstringsize)(" ", NULL, NULL); /* scroll forward the whole time */ -- cgit v1.2.3