From 7ea67301d7df8fb5ff35c090cdf0c2653a7956a3 Mon Sep 17 00:00:00 2001 From: Themba Dube Date: Sun, 18 Aug 2019 16:00:57 -0400 Subject: [PATCH] Fix off-by-one error in lv_label_set_text_fmt --- src/lv_objx/lv_label.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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*/