forked from enlightenment/efl
elm_font: Remove unnecessary realloc
This commit is contained in:
parent
aea9b1d262
commit
c6190fa7bb
|
@ -33,12 +33,7 @@ _elm_font_properties_get(Eina_Hash **font_hash,
|
||||||
if (subname)
|
if (subname)
|
||||||
{
|
{
|
||||||
len = subname - name;
|
len = subname - name;
|
||||||
name = realloc(name, sizeof(char) * len + 1);
|
*subname = '\0';
|
||||||
if (name)
|
|
||||||
{
|
|
||||||
memset(name, 0, sizeof(char) * len + 1);
|
|
||||||
strncpy(name, font, len);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* add a font name */
|
/* add a font name */
|
||||||
|
@ -53,7 +48,7 @@ _elm_font_properties_get(Eina_Hash **font_hash,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
efp->name = eina_stringshare_add(name);
|
efp->name = eina_stringshare_add_length(name, len);
|
||||||
if (font_hash)
|
if (font_hash)
|
||||||
{
|
{
|
||||||
if (!*font_hash)
|
if (!*font_hash)
|
||||||
|
|
Loading…
Reference in New Issue