1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

fix(txt) _lv_txt_get_next_line return 0 on empty texts

fixes #2615
This commit is contained in:
Gabor Kiss-Vamosi 2021-09-29 14:04:11 +02:00
parent e83eadf73a
commit 82f3fbcad7

View File

@ -296,6 +296,7 @@ uint32_t _lv_txt_get_next_line(const char * txt, const lv_font_t * font,
lv_coord_t letter_space, lv_coord_t max_width, lv_text_flag_t flag)
{
if(txt == NULL) return 0;
if(txt[0] == '\0') return 0;
if(font == NULL) return 0;
/*If max_width doesn't mater simply find the new line character