Browse Source

do correct casting

PHP-5
Stefan Esser 23 years ago
parent
commit
e900f8c97b
  1. 6
      ext/mime_magic/mime_magic.c

6
ext/mime_magic/mime_magic.c

@ -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;
}

Loading…
Cancel
Save