summaryrefslogtreecommitdiff
path: root/ext/sqlite/sqlite.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2004-03-07 21:57:50 +0000
committerIlia Alshanetsky <iliaa@php.net>2004-03-07 21:57:50 +0000
commit0eb7000b0ab26d45640fa83c467bfb03c0de61bc (patch)
tree768a02d310ed1c3870f7450e9f2802746d2fe9a9 /ext/sqlite/sqlite.c
parent0dd22801027ebc3c1e19a451780c9f5348972765 (diff)
downloadphp-git-0eb7000b0ab26d45640fa83c467bfb03c0de61bc.tar.gz
Corrected string escape calculation.
Diffstat (limited to 'ext/sqlite/sqlite.c')
-rw-r--r--ext/sqlite/sqlite.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c
index 4af4001ea5..89235687cf 100644
--- a/ext/sqlite/sqlite.c
+++ b/ext/sqlite/sqlite.c
@@ -2611,7 +2611,7 @@ PHP_FUNCTION(sqlite_escape_string)
/* binary string */
int enclen;
- ret = emalloc( 1 + 5 + stringlen * (256 / 253) );
+ ret = emalloc( 1 + 5 + stringlen * ((float) 256 / (float) 253) );
ret[0] = '\x01';
enclen = php_sqlite_encode_binary(string, stringlen, ret+1);
RETVAL_STRINGL(ret, enclen+1, 0);
@@ -2841,7 +2841,7 @@ PHP_FUNCTION(sqlite_udf_encode_binary)
int enclen;
char *ret;
- ret = emalloc( 1 + 5 + datalen * (256 / 253) );
+ ret = emalloc( 1 + 5 + datalen * ((float) 256 / (float) 253) );
ret[0] = '\x01';
enclen = php_sqlite_encode_binary(data, datalen, ret+1);
RETVAL_STRINGL(ret, enclen+1, 0);