From: Lars Poeschel <poesc...@lemonage.de>

Skip printing characters at the end of a display line. This fits to the
behaviour we already had, that the cursor is nailed to last position of
a line.

Signed-off-by: Lars Poeschel <poesc...@lemonage.de>
---
 drivers/auxdisplay/charlcd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c
index cd3a304c08ec..1d5b3af9cca7 100644
--- a/drivers/auxdisplay/charlcd.c
+++ b/drivers/auxdisplay/charlcd.c
@@ -111,6 +111,9 @@ static void charlcd_home(struct charlcd *lcd)
 
 static void charlcd_print(struct charlcd *lcd, char c)
 {
+       if (lcd->addr.x >= lcd->width)
+               return;
+
        if (lcd->char_conv)
                c = lcd->char_conv[(unsigned char)c];
 
-- 
2.28.0

Reply via email to