Enlightenment CVS committal

Author  : tsauerbeck
Project : e17
Module  : libs/eet

Dir     : e17/libs/eet/src/lib


Modified Files:
        eet_lib.c 


Log Message:
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
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/eet/src/lib/eet_lib.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -3 -r1.26 -r1.27
--- eet_lib.c   17 Jan 2005 08:27:23 -0000      1.26
+++ eet_lib.c   3 Feb 2005 17:20:29 -0000       1.27
@@ -715,17 +715,19 @@
    int   hash, i, num;
 
    /* 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;
        return NULL;
      }
-   /* get hash bucket this should be in */
-   hash = eet_hash_gen(name, ef->header->directory->size);
    /* no header, return NULL */
    if (!ef->header) return NULL;
    /* no 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 */
    num = ef->header->directory->hash[hash].size;
    for (i = 0; i < num; i++)




-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to