=== modified file 'libusplash.c' --- libusplash.c 2008-03-09 23:33:04 +0000 +++ libusplash.c 2008-10-17 17:49:33 +0000 @@ -951,7 +951,7 @@ if (theme->draw_status) { theme->draw_status(theme, string, len, mode); } else { - int x1, y1, fg; + int x1, y1, fg, slen, i; if (mode < 0) fg = theme->text_failure; @@ -963,9 +963,17 @@ x1 = text_x2 - theme->status_width; y1 = text_y2 - theme->line_height; - usplash_clear(x1, y1, text_x2, text_y2, + // check lenght of status string, that should not overflow the box. + slen = 0; + for (i = 0; i < len; i++) { + slen += usplash_getfontwidth(*(string + i )); + if ( slen > theme->status_width ) + break; + } + + usplash_clear(text_x2 - slen, y1, text_x2, text_y2, theme->text_background); - usplash_text(x1, y1, string, len, fg, + usplash_text(text_x2 - slen , y1, string , i, fg, theme->text_background); } unblocksig();