fix(span): explicitly set span->txt to the return value of lv_mem_realloc(#3005)
* Update lv_span.c Explicitly set `span->txt` to return of `lv_mem_realloc` * Update lv_mem.h Add note about `lv_mem_realloc` return value on failure
This commit is contained in:
@@ -152,7 +152,7 @@ void lv_span_set_text(lv_span_t * span, const char * text)
|
||||
span->txt = lv_mem_alloc(strlen(text) + 1);
|
||||
}
|
||||
else {
|
||||
lv_mem_realloc(span->txt, strlen(text) + 1);
|
||||
span->txt = lv_mem_realloc(span->txt, strlen(text) + 1);
|
||||
}
|
||||
span->static_flag = 0;
|
||||
strcpy(span->txt, text);
|
||||
|
||||
@@ -84,7 +84,7 @@ void lv_mem_free(void * data);
|
||||
* @param data pointer to an allocated memory.
|
||||
* Its content will be copied to the new memory block and freed
|
||||
* @param new_size the desired new size in byte
|
||||
* @return pointer to the new memory
|
||||
* @return pointer to the new memory, NULL on failure
|
||||
*/
|
||||
void * lv_mem_realloc(void * data_p, size_t new_size);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user