]> granicus.if.org Git - php/commitdiff
Fix hash_init() for PHP < 6
authorSara Golemon <pollita@php.net>
Fri, 24 Aug 2007 21:27:38 +0000 (21:27 +0000)
committerSara Golemon <pollita@php.net>
Fri, 24 Aug 2007 21:27:38 +0000 (21:27 +0000)
ext/hash/hash.c

index d7403215bd2de5b1bed01dee780157bc786a4fa3..d12899e510adf8ab5e6c14932682286f54b542a7 100644 (file)
@@ -341,13 +341,18 @@ PHP_FUNCTION(hash_init)
 {
        char *algo, *key = NULL;
        int algo_len, key_len = 0, argc = ZEND_NUM_ARGS();
-       zend_uchar key_type;
        long options = 0;
        void *context;
        const php_hash_ops *ops;
        php_hash_data *hash;
 
+#if PHP_MAJOR_VERSION >= 6
+       zend_uchar key_type;
+
        if (zend_parse_parameters(argc TSRMLS_CC, "s|lt", &algo, &algo_len, &options, &key, &key_len, &key_type) == FAILURE) {
+#else
+       if (zend_parse_parameters(argc TSRMLS_CC, "s|ls", &algo, &algo_len, &options, &key, &key_len) == FAILURE) {
+#endif
                return;
        }