forked from enlightenment/efl
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:
parent
69d0626265
commit
1576311af3
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue