forked from enlightenment/efl
eet: do the correct math for allocation.
This commit is contained in:
parent
5b8ce3026f
commit
f001cfac38
|
@ -132,7 +132,7 @@ eet_dictionary_string_add(Eet_Dictionary *ed,
|
||||||
if (!new_hash) goto on_error;
|
if (!new_hash) goto on_error;
|
||||||
ed->all_hash = new_hash;
|
ed->all_hash = new_hash;
|
||||||
|
|
||||||
new_allocated = realloc(ed->all_allocated, total * sizeof (unsigned char));
|
new_allocated = realloc(ed->all_allocated, ((total >> 3) + 1) * sizeof (unsigned char));
|
||||||
if (!new_allocated) goto on_error;
|
if (!new_allocated) goto on_error;
|
||||||
ed->all_allocated = new_allocated;
|
ed->all_allocated = new_allocated;
|
||||||
|
|
||||||
|
|
|
@ -946,7 +946,7 @@ eet_internal_read2(Eet_File *ef)
|
||||||
if (eet_test_close(!ef->ed->all_hash, ef))
|
if (eet_test_close(!ef->ed->all_hash, ef))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
ef->ed->all_allocated = calloc(1, ((num_dictionary_entries >> 8) + 1) * sizeof (unsigned char));
|
ef->ed->all_allocated = calloc(1, ((num_dictionary_entries >> 3) + 1) * sizeof (unsigned char));
|
||||||
if (eet_test_close(!ef->ed->all_allocated, ef))
|
if (eet_test_close(!ef->ed->all_allocated, ef))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue