summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorArd Biesheuvel <abies@php.net>2003-09-04 14:44:34 +0000
committerArd Biesheuvel <abies@php.net>2003-09-04 14:44:34 +0000
commitf4511d4aae675acd4b56de01401ce94e1cc4b57c (patch)
tree4a8230807606af9fc402ed8ae6c1c5c35c1de908 /ext
parente5e6040efe9f45b018db8d446aadff8038690623 (diff)
downloadphp-git-f4511d4aae675acd4b56de01401ce94e1cc4b57c.tar.gz
Don't rely on sizeof(int) == 4
Diffstat (limited to 'ext')
-rw-r--r--ext/interbase/interbase.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c
index 408586a8a6..ed0c1b197e 100644
--- a/ext/interbase/interbase.c
+++ b/ext/interbase/interbase.c
@@ -52,6 +52,9 @@
#define SAFE_STRING(s) ((s)?(s):"")
+#define ISC_LONG_MIN (-ISC_LONG_MAX - 1)
+#define ISC_LONG_MAX 2147483647
+
#ifdef PHP_WIN32
# ifndef ISC_UINT64
# define ISC_UINT64 unsigned __int64
@@ -1363,7 +1366,7 @@ static int _php_ibase_bind(XSQLDA *sqlda, zval **b_vars, BIND_BUF *buf, ibase_qu
convert_to_long(b_var);
#if (SIZEOF_LONG > 4)
/* ISC_LONG is always 32-bit */
- if (Z_LVAL_P(b_var) > INT_MAX || Z_LVAL_P(b_var) < INT_MIN) {
+ if (Z_LVAL_P(b_var) > ISC_LONG_MAX || Z_LVAL_P(b_var) < ISC_LONG_MIN) {
_php_ibase_module_error("Parameter %d exceeds field width" TSRMLS_CC, i+1);
rv = FAILURE;
}