evas textblock - use snprintf to limit buffer and have buffer big enough

the buffer wasn't big enough for all possible content anyway and it
didn't use snprintf, so large values of i could overflow... pointed to
by warning. fix that warning.
This commit is contained in:
Carsten Haitzler 2019-12-19 10:33:37 +00:00
parent ed7fb7ae27
commit e2887ec2aa
1 changed files with 2 additions and 2 deletions

View File

@ -15631,9 +15631,9 @@ void fit_style_update(Evas_Object *object, int i_font_size, Eina_Bool disable_el
char * fit_style = fc->fit_style; char * fit_style = fc->fit_style;
if (i_font_size >= 0) if (i_font_size >= 0)
{ {
char font_size[0xF] = {0}; char font_size[24];
char *pfont = font_size; char *pfont = font_size;
sprintf(font_size, "font_size=%i ", i_font_size); snprintf(font_size, sizeof(font_size), "font_size=%i ", i_font_size);
while (*pfont) while (*pfont)
{ {
*fit_style = *pfont; *fit_style = *pfont;