summaryrefslogtreecommitdiffstats
path: root/ext/misc/sqlar.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/misc/sqlar.c')
-rw-r--r--ext/misc/sqlar.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/misc/sqlar.c b/ext/misc/sqlar.c
index be079a5..9f726f0 100644
--- a/ext/misc/sqlar.c
+++ b/ext/misc/sqlar.c
@@ -81,7 +81,7 @@ static void sqlarUncompressFunc(
sqlite3_value **argv
){
uLong nData;
- uLongf sz;
+ sqlite3_int64 sz;
assert( argc==2 );
sz = sqlite3_value_int(argv[1]);
@@ -89,14 +89,15 @@ static void sqlarUncompressFunc(
if( sz<=0 || sz==(nData = sqlite3_value_bytes(argv[0])) ){
sqlite3_result_value(context, argv[0]);
}else{
+ uLongf szf = sz;
const Bytef *pData= sqlite3_value_blob(argv[0]);
Bytef *pOut = sqlite3_malloc(sz);
if( pOut==0 ){
sqlite3_result_error_nomem(context);
- }else if( Z_OK!=uncompress(pOut, &sz, pData, nData) ){
+ }else if( Z_OK!=uncompress(pOut, &szf, pData, nData) ){
sqlite3_result_error(context, "error in uncompress()", -1);
}else{
- sqlite3_result_blob(context, pOut, sz, SQLITE_TRANSIENT);
+ sqlite3_result_blob(context, pOut, szf, SQLITE_TRANSIENT);
}
sqlite3_free(pOut);
}