mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
Fix off-by-one error in lv_label_set_text_fmt
This commit is contained in:
parent
d5d8eb5afd
commit
7ea67301d7
@ -241,7 +241,7 @@ void lv_label_set_text_fmt(lv_obj_t * label, const char * fmt, ...)
|
||||
if(ext->text == NULL) return;
|
||||
ext->text[len-1] = 0; /* Ensure NULL termination */
|
||||
|
||||
lv_vsnprintf(ext->text, len, fmt, ap2);
|
||||
lv_vsnprintf(ext->text, len+1, fmt, ap2);
|
||||
|
||||
va_end(ap2);
|
||||
ext->static_txt = 0; /*Now the text is dynamically allocated*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user