]> granicus.if.org Git - php/commitdiff
restore the old part of ezmlm_hash()
authorAnatol Belski <ab@php.net>
Wed, 27 Aug 2014 21:14:54 +0000 (23:14 +0200)
committerAnatol Belski <ab@php.net>
Wed, 27 Aug 2014 21:14:54 +0000 (23:14 +0200)
ext/standard/mail.c

index 4efbb77877efd9781f5fda045d2fe4458b318d45..3404ebe2ac0f42aac81576351745cccd7e0de1b3 100644 (file)
@@ -79,7 +79,7 @@ extern zend_long php_getuid(TSRMLS_D);
 PHP_FUNCTION(ezmlm_hash)
 {
        char *str = NULL;
-       zend_ulong h = Z_UL(5381);
+       unsigned int h = 5381;
        size_t j, str_len;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
@@ -87,10 +87,10 @@ PHP_FUNCTION(ezmlm_hash)
        }
 
        for (j = 0; j < str_len; j++) {
-               h = (h + (h << Z_UL(5))) ^ (zend_ulong) (unsigned char) tolower(str[j]);
+               h = (h + (h << 5)) ^ (zend_ulong) (unsigned char) tolower(str[j]);
        }
 
-       h = (h % Z_UL(53));
+       h = (h % 53);
 
        RETURN_LONG((zend_long) h);
 }