From 24844a70c05f3555ec883273a6a619c393ac9b95 Mon Sep 17 00:00:00 2001 From: Lyndon Date: Wed, 25 Dec 2024 16:41:31 +0800 Subject: [PATCH] fix: reset length to zero partial loading requires that length is zero to get real length. --- quickjs/ckb_module.c | 1 + 1 file changed, 1 insertion(+) diff --git a/quickjs/ckb_module.c b/quickjs/ckb_module.c index 71703b0..16ad5c1 100644 --- a/quickjs/ckb_module.c +++ b/quickjs/ckb_module.c @@ -119,6 +119,7 @@ static JSValue syscall_load(JSContext *ctx, LoadData *data) { } // no length specified, read to the end if (data->length == NO_VALUE) { + data->length = 0; err = data->func(0, &data->length, data); CHECK(err); }