Skip to content

Commit 3200a6b

Browse files
committed
fix: incorrect byte length returned by json_doc_write_to_str
1 parent 574423a commit 3200a6b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

extensions/yyjson/json_natives.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ static cell_t json_doc_write_to_str(IPluginContext* pContext, const cell_t* para
11781178

11791179
pContext->StringToLocalUTF8(params[2], buffer_size, temp_buffer, nullptr);
11801180
free(temp_buffer);
1181-
return static_cast<cell_t>(output_len + 1);
1181+
return static_cast<cell_t>(output_len);
11821182
}
11831183

11841184
static cell_t json_doc_write_to_file(IPluginContext* pContext, const cell_t* params)

0 commit comments

Comments
 (0)