ibireme / yyjson

The fastest JSON library in C
https://ibireme.github.io/yyjson/doc/doxygen/html/
MIT License
3.07k stars 267 forks source link

Correct the error in the comment for unsafe_yyjson_mut_strncpy #159

Closed hxdnshx closed 7 months ago

hxdnshx commented 7 months ago

Similar to yyjson_mut_obj_add_strcpy, in fact, the val & len in yyjson_mut_obj_add_strncpy have already been assigned values and do not need to have their lifetimes guaranteed. https://github.com/ibireme/yyjson/blob/0eca326fe57aeeb866e6f04c9ef9ea9f8343157e/src/yyjson.h#L6963-L6974 The call to unsafe_yyjson_mut_strncpy in the above code also proves this point.

ibireme commented 7 months ago

Thanks.