alloc the right amount of mem

sizeof(char) is 1, and sizeof(char *) is wrong for strings

SVN revision: 50782
This commit is contained in:
Sebastian Dransfeld 2010-08-03 19:31:24 +00:00
parent 69d0626265
commit 1576311af3
2 changed files with 2 additions and 2 deletions

View File

@ -522,7 +522,7 @@ efreet_ini_localestring_get(Efreet_Ini *ini, const char *key)
if (country) maxlen += strlen(country);
if (modifier) maxlen += strlen(modifier);
buf = alloca(maxlen * sizeof(char));
buf = alloca(maxlen);
if (lang && modifier && country)
{

View File

@ -953,7 +953,7 @@ efreet_menu_dump(Efreet_Menu *menu, const char *indent)
size_t len;
len = strlen(indent) + 3;
new_indent = alloca(sizeof(char *) * len);
new_indent = alloca(len);
snprintf(new_indent, len, "%s ", indent);
EINA_LIST_FOREACH(menu->entries, l, entry)