better fix bug #20641.

Overflow numeric/decimal datatype on NT
This commit is contained in:
Daniela Mariaschi 2003-05-14 08:22:54 +00:00
parent 7ddb7f15d4
commit 82d513ee72
2 changed files with 8 additions and 1 deletions

View File

@ -1828,7 +1828,8 @@ static int _php_ibase_var_zval(zval *val, void *data, int type, int len, int sca
sprintf(dt, "%%0.%df", -scale);
Z_STRLEN_P(val) = sprintf (string_data, dt, number / f);
} else {
Z_STRLEN_P(val) = sprintf (string_data, "%.0f", (double) (ISC_INT64) (*((ISC_INT64 *) data)));
Z_STRLEN_P(val) =sprintf (string_data, "%.0" ISC_INT64_FORMAT "d",
(ISC_INT64) *(ISC_INT64 *) data);
}
Z_STRVAL_P(val) = estrdup(string_data);

View File

@ -30,8 +30,14 @@ extern zend_module_entry ibase_module_entry;
#ifdef PHP_WIN32
#define PHP_IBASE_API __declspec(dllexport)
#ifndef ISC_INT64_FORMAT
#define ISC_INT64_FORMAT "I64"
#endif
#else
#define PHP_IBASE_API
#ifndef ISC_INT64_FORMAT
#define ISC_INT64_FORMAT "ll"
#endif
#endif
PHP_MINIT_FUNCTION(ibase);