diff --git a/src/lv_objx/lv_label.c b/src/lv_objx/lv_label.c index 727a7e9e4..a6cff45f2 100644 --- a/src/lv_objx/lv_label.c +++ b/src/lv_objx/lv_label.c @@ -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*/