struct2json icon indicating copy to clipboard operation
struct2json copied to clipboard

strncpy length?

Open yuxuebao opened this issue 4 years ago • 1 comments

struct2json\inc\s2jdef.h line93 strncpy((to_struct)->_element[index], from_json->valuestring,sizeof((to_struct)->_element)-1); 是不是应该是 strncpy((to_struct)->_element[index], from_json->valuestring,sizeof((to_struct)->_element[index])-1); struct2json\inc\s2jdef.h line106 同样问题.

yuxuebao avatar Feb 22 '21 01:02 yuxuebao

看着是的,copy 的长度限制应该是数组元素的长度

armink avatar Feb 22 '21 06:02 armink