summaryrefslogtreecommitdiff
path: root/framebuffer/fb_font.c
diff options
context:
space:
mode:
Diffstat (limited to 'framebuffer/fb_font.c')
-rw-r--r--framebuffer/fb_font.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/framebuffer/fb_font.c b/framebuffer/fb_font.c
index 0f416e865..aa81484d9 100644
--- a/framebuffer/fb_font.c
+++ b/framebuffer/fb_font.c
@@ -79,6 +79,8 @@ static bool nsfont_position_in_string(const struct css_style *style,
{
const struct fb_font_desc* fb_font = fb_get_font(style);
*char_offset = x / fb_font->width;
+ if (*char_offset > length)
+ *char_offset = length;
*actual_x = *char_offset * fb_font->width;
return true;
}