From 3200a6ba1aa7f8939e5cbb3bbbf668623672125e Mon Sep 17 00:00:00 2001 From: ProjectSky Date: Sat, 18 Oct 2025 21:26:46 +0800 Subject: [PATCH] fix: incorrect byte length returned by json_doc_write_to_str --- extensions/yyjson/json_natives.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/yyjson/json_natives.cpp b/extensions/yyjson/json_natives.cpp index d6c06b566..ea3e902e7 100755 --- a/extensions/yyjson/json_natives.cpp +++ b/extensions/yyjson/json_natives.cpp @@ -1178,7 +1178,7 @@ static cell_t json_doc_write_to_str(IPluginContext* pContext, const cell_t* para pContext->StringToLocalUTF8(params[2], buffer_size, temp_buffer, nullptr); free(temp_buffer); - return static_cast(output_len + 1); + return static_cast(output_len); } static cell_t json_doc_write_to_file(IPluginContext* pContext, const cell_t* params)