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