We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
string_append_subcstr 当遇到 '\0' 字符时,整个 '\0' 之后的字符串会被截断,即使字符串长度参数设为很大也不起作用。
建议 string 中可容纳 '\0' 字符,以保持和 c++ 中的 stl 一致,对于 c++ 程序,我经常通过类似于如下的代码来存放数据: string buffer("hello\0, world.", 14);
之所以选择 string,是因为它很适合存储网络或串口数据,并提供了一些相关的算法方便解析数据,因此建议对于该功能,有必要考虑一下是否增加。
同样,对于获取数据时也可根据需要不截断 '\0' 数据。
The text was updated successfully, but these errors were encountered:
basic_string_t类型的所有涉及到subcstr的函数的行为与STL的行为都不相符,原因是libcstl没有正确的处理subcstr的长度,而参考了subcstr中终结符的位置来计算长度,实际上subcstr函数中终结符是应该作为普通字符处理的。并且在其他内部的处理函数上,对于basic_string_t中包含的终结符要做特殊的处理,这与其他的容器不一致。
Sorry, something went wrong.
确认一下其他容器的array函数是否有类似的情况。
string_append_subcstr是一类terminator问题,在2.2版本中全部解决了,其他容器的init_copy_array函数不存在这样的问题,因为terminator是非法的字符。
No branches or pull requests
string_append_subcstr 当遇到 '\0' 字符时,整个 '\0' 之后的字符串会被截断,即使字符串长度参数设为很大也不起作用。
建议 string 中可容纳 '\0' 字符,以保持和 c++ 中的 stl 一致,对于 c++ 程序,我经常通过类似于如下的代码来存放数据:
string buffer("hello\0, world.", 14);
之所以选择 string,是因为它很适合存储网络或串口数据,并提供了一些相关的算法方便解析数据,因此建议对于该功能,有必要考虑一下是否增加。
同样,对于获取数据时也可根据需要不截断 '\0' 数据。
The text was updated successfully, but these errors were encountered: