summaryrefslogtreecommitdiffstats
path: root/scrypt-pr47.patch
blob: 459c1538798b7a31a6df6824e45c7c4dc8fba13e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 52f0b3dbc28a2acbcce356ee657081ff12acd20d Mon Sep 17 00:00:00 2001
From: Remi Collet <fedora@famillecollet.com>
Date: Wed, 18 May 2016 14:59:34 +0200
Subject: [PATCH] fix zend_parse_parameters call, fix #46

---
 php_scrypt.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/php_scrypt.c b/php_scrypt.c
index 97c38f1..df1f04f 100644
--- a/php_scrypt.c
+++ b/php_scrypt.c
@@ -43,6 +43,12 @@
 
 #include "math.h"
 
+#if PHP_MAJOR_VERSION >= 7
+typedef size_t strsize_t;
+#else
+typedef int    strsize_t;
+#endif
+
 /* {{{ arginfo */
 ZEND_BEGIN_ARG_INFO_EX(scrypt_arginfo, 0, 0, 6)
     ZEND_ARG_INFO(0, password)
@@ -115,10 +121,10 @@ PHP_FUNCTION(scrypt)
 {
     /* Variables for PHP's parameters */
     unsigned char *password;
-    int password_len;
+    strsize_t password_len;
 
     unsigned char *salt;
-    int salt_len;
+    strsize_t salt_len;
 
     long phpN;
     long phpR;