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
tb_buffer_t b; tb_buffer_init(&b); tb_buffer_memncpy(&b, (tb_byte_t const*)"hello", 6); // data[0-5] tb_trace_i("%s", tb_buffer_data(&b)); printf("size: %ld\n", tb_buffer_size(&b)); printf("maxn: %ld\n", tb_buffer_maxn(&b)); printf("data[%ld]=%d\n", tb_buffer_size(&b), *((char*)tb_buffer_data(&b)+tb_buffer_size(&b))); printf("data[%ld]=%d\n", tb_buffer_size(&b)+1, *((char*)tb_buffer_data(&b)+tb_buffer_size(&b)+1)); // 此刻,缓冲区中的数据,即从data[0]到data[5]为hello\0 tb_buffer_memsetp(&b, 4, 65); // 按我的理解,本行会把data[4]到data[5]赋成字符A tb_trace_i("%s", tb_buffer_data(&b)); // 然而写入了6个A: hellAAAAAA tb_buffer_exit(&b);
The text was updated successfully, but these errors were encountered:
我修复了,再试下,dev 分支。。
Sorry, something went wrong.
aaf266f
试了,修好了。
No branches or pull requests
描述问题
The text was updated successfully, but these errors were encountered: