diff options
author | William Wilgus <me.theuser@yahoo.com> | 2018-07-25 19:56:53 +0200 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2018-07-25 19:56:53 +0200 |
commit | 540637ed3334364fe9d1b54cdc96a52f59afda83 (patch) | |
tree | 21246e4beac87b08829220a2ac91a3d09c83b74b | |
parent | 5e5ddce270ce8fb87baff7ce898173fe2ae2fb6b (diff) | |
download | rockbox-540637ed3334364fe9d1b54cdc96a52f59afda83.tar.gz rockbox-540637ed3334364fe9d1b54cdc96a52f59afda83.zip |
Ignore truncation in lcd-scroll.c
Change-Id: Id1008300e58cf12ab920c1023354a74a6d32daae
-rw-r--r-- | firmware/drivers/lcd-scroll.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/firmware/drivers/lcd-scroll.c b/firmware/drivers/lcd-scroll.c index 0e17303bd3..dd6a6fe8cb 100644 --- a/firmware/drivers/lcd-scroll.c +++ b/firmware/drivers/lcd-scroll.c | |||
@@ -140,6 +140,7 @@ void LCDFN(jump_scroll_delay)(int ms) | |||
140 | * Returns true if the text scrolled to the end */ | 140 | * Returns true if the text scrolled to the end */ |
141 | bool LCDFN(scroll_now)(struct scrollinfo *s) | 141 | bool LCDFN(scroll_now)(struct scrollinfo *s) |
142 | { | 142 | { |
143 | int len; | ||
143 | int width = LCDFN(getstringsize)(s->linebuffer, NULL, NULL); | 144 | int width = LCDFN(getstringsize)(s->linebuffer, NULL, NULL); |
144 | bool ended = false; | 145 | bool ended = false; |
145 | /* assume s->scroll_func() don't yield; otherwise this buffer might need | 146 | /* assume s->scroll_func() don't yield; otherwise this buffer might need |
@@ -164,8 +165,12 @@ bool LCDFN(scroll_now)(struct scrollinfo *s) | |||
164 | } | 165 | } |
165 | else | 166 | else |
166 | { | 167 | { |
167 | snprintf(line_buf, sizeof(line_buf)-1, "%s%s%s", | 168 | len = snprintf(line_buf, sizeof(line_buf)-1, "%s%s%s", |
168 | s->linebuffer, " ", s->linebuffer); | 169 | s->linebuffer, " ", s->linebuffer); |
170 | |||
171 | if ((unsigned) len > sizeof(line_buf)) | ||
172 | do { } while (0); /* ignore truncation */ | ||
173 | |||
169 | s->line = line_buf; | 174 | s->line = line_buf; |
170 | width += LCDFN(getstringsize)(" ", NULL, NULL); | 175 | width += LCDFN(getstringsize)(" ", NULL, NULL); |
171 | /* scroll forward the whole time */ | 176 | /* scroll forward the whole time */ |