elm_font: Remove unnecessary realloc

This commit is contained in:
Ryuan Choi 2013-06-25 19:30:56 +09:00
parent aea9b1d262
commit c6190fa7bb
1 changed files with 2 additions and 7 deletions

View File

@ -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)