]> granicus.if.org Git - php/commitdiff
Fixed unregistered bug: corrupted 32-bit LONGs on 64-bit systems
authorArd Biesheuvel <abies@php.net>
Thu, 13 Jan 2005 21:22:13 +0000 (21:22 +0000)
committerArd Biesheuvel <abies@php.net>
Thu, 13 Jan 2005 21:22:13 +0000 (21:22 +0000)
ext/interbase/interbase.c

index e51f37ce9fe29682cbc97acbe982f6661808405f..6372ebb7b42982a48d59c55c8b8add38fe5ff0ef 100644 (file)
@@ -1802,9 +1802,9 @@ static int _php_ibase_var_zval(zval *val, void *data, int type, int len, int sca
                                short j;
                                long n, f = 1;
                                if ( (type & ~1) == SQL_SHORT) {
-                                       n = (long) *(short *) (data);
+                                       n = *(short *) data;
                                }else { 
-                                       n = (long) *(long *) (data);
+                                       n = *(ISC_LONG *) data;
                                }
                                for (j = 0; j < -scale; j++) {
                                        f *= 10;
@@ -1821,9 +1821,9 @@ static int _php_ibase_var_zval(zval *val, void *data, int type, int len, int sca
                        } else {
                                Z_TYPE_P(val) = IS_LONG;
                                if ( (type & ~1) == SQL_SHORT) {
-                                       Z_LVAL_P(val) = *(short *) (data);
+                                       Z_LVAL_P(val) = *(short *) data;
                                }else{
-                                       Z_LVAL_P(val) = *(long *) (data);
+                                       Z_LVAL_P(val) = *(ISC_LONG *) data;
                                }
                        }
                        break;