forked from enlightenment/efl
if an EET is opened for EET_FILE_MODE_WRITE, don't permit eet_read() calls. and don't die if the header isn't set up correctly yet
SVN revision: 13187
This commit is contained in:
parent
10707730c1
commit
3a5190d3bd
|
@ -715,17 +715,19 @@ eet_read(Eet_File *ef, char *name, int *size_ret)
|
||||||
int hash, i, num;
|
int hash, i, num;
|
||||||
|
|
||||||
/* check to see its' an eet file pointer */
|
/* check to see its' an eet file pointer */
|
||||||
if ((!ef) || (ef->magic != EET_MAGIC_FILE) || (!name))
|
if ((!ef) || (ef->magic != EET_MAGIC_FILE) || (!name) ||
|
||||||
|
((ef->mode != EET_FILE_MODE_READ) &&
|
||||||
|
(ef->mode != EET_FILE_MODE_RW)))
|
||||||
{
|
{
|
||||||
if (size_ret) *size_ret = 0;
|
if (size_ret) *size_ret = 0;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
/* get hash bucket this should be in */
|
|
||||||
hash = eet_hash_gen(name, ef->header->directory->size);
|
|
||||||
/* no header, return NULL */
|
/* no header, return NULL */
|
||||||
if (!ef->header) return NULL;
|
if (!ef->header) return NULL;
|
||||||
/* no directory, return NULL */
|
/* no directory, return NULL */
|
||||||
if (!ef->header->directory) return NULL;
|
if (!ef->header->directory) return NULL;
|
||||||
|
/* get hash bucket this should be in */
|
||||||
|
hash = eet_hash_gen(name, ef->header->directory->size);
|
||||||
/* hunt hash bucket */
|
/* hunt hash bucket */
|
||||||
num = ef->header->directory->hash[hash].size;
|
num = ef->header->directory->hash[hash].size;
|
||||||
for (i = 0; i < num; i++)
|
for (i = 0; i < num; i++)
|
||||||
|
|
Loading…
Reference in New Issue