]> granicus.if.org Git - php/commitdiff
MFH
authorStefan Esser <sesser@php.net>
Tue, 24 Dec 2002 23:30:51 +0000 (23:30 +0000)
committerStefan Esser <sesser@php.net>
Tue, 24 Dec 2002 23:30:51 +0000 (23:30 +0000)
ext/mime_magic/mime_magic.c

index d0ed717f8884c2e572bb4a60c74c2e490e5df95a..84b21a10a5d404be36fd733bb410f54e422ef04f 100644 (file)
@@ -12,7 +12,7 @@
   | obtain it through the world-wide-web, please send a note to          |
   | license@php.net so we can mail you a copy immediately.               |
   +----------------------------------------------------------------------+
-  | Author: Hartmut Holzgraefe  <hartmut@six.de>                         |
+  | Author: Hartmut Holzgraefe  <hholzgra@php.net>                       |
   +----------------------------------------------------------------------+
 
   $Id$ 
@@ -274,7 +274,7 @@ PHP_MINIT_FUNCTION(mime_magic)
 PHP_MSHUTDOWN_FUNCTION(mime_magic)
 {
        UNREGISTER_INI_ENTRIES();
-       if (mime_global.magic != NULL && (int)mime_global.magic != -1) {
+       if (mime_global.magic != NULL && mime_global.magic != (struct magic *) -1) {
                struct magic *iter = mime_global.magic;
                while (iter != NULL) {
                        struct magic *iter_next = iter->next;   
@@ -312,7 +312,7 @@ PHP_FUNCTION(mime_content_type)
                return;
        }
 
-       if ((int) conf->magic == -1) {
+       if (conf->magic == (struct magic *)-1) {
                php_error(E_ERROR, MODNAME " could not be initialized, magic file %s is not avaliable",  conf->magicfile);
                RETURN_FALSE;
        } 
@@ -358,7 +358,7 @@ static int apprentice(void)
     fname = conf->magicfile; /* todo cwd? */
     f = fopen(fname, "rb");
     if (f == NULL) {
-               *(int *)&conf->magic = -1;
+               conf->magic = (struct magic *)-1;
                return -1;
     }