lcd_print_pad: do not overflow len when truncating the string
This commit is contained in:
parent
6bee4fec8d
commit
aa721cafd9
@ -530,7 +530,10 @@ void lcd_print(const char* s)
|
|||||||
|
|
||||||
void lcd_print_pad(const char* s, uint8_t len)
|
void lcd_print_pad(const char* s, uint8_t len)
|
||||||
{
|
{
|
||||||
while (len-- && *s) lcd_write(*(s++));
|
while (len && *s) {
|
||||||
|
lcd_write(*(s++));
|
||||||
|
--len;
|
||||||
|
}
|
||||||
lcd_space(len);
|
lcd_space(len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user