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)
|
||||
{
|
||||
len = subname - name;
|
||||
name = realloc(name, sizeof(char) * len + 1);
|
||||
if (name)
|
||||
{
|
||||
memset(name, 0, sizeof(char) * len + 1);
|
||||
strncpy(name, font, len);
|
||||
}
|
||||
*subname = '\0';
|
||||
}
|
||||
|
||||
/* add a font name */
|
||||
|
@ -53,7 +48,7 @@ _elm_font_properties_get(Eina_Hash **font_hash,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
efp->name = eina_stringshare_add(name);
|
||||
efp->name = eina_stringshare_add_length(name, len);
|
||||
if (font_hash)
|
||||
{
|
||||
if (!*font_hash)
|
||||
|
|
Loading…
Reference in New Issue