Closed curoles closed 11 months ago
let me check failing tests
Test UTEST(utf8ncpy, truncated_copy_null_terminated)
fails. Someone with better understanding of what this test is expecting should have a look.
If char cpy2[2] = {'\0'};
and const char data[] = { '\xce', '\x93',...
then I am not sure why following must be true:
utf8ncpy(cpy2, data, 2);
ASSERT_EQ('\0', cpy2[0]);
I added a print-out to make sure where/how exactly the test fails, as I suspected it fails at ASSERT_EQ('\0', cpy2[0]);
:
cpy2[0]=ce, cpy2[1]=93
I believe I fixed one more issue when destination string it too small to store codepoint plus null terminator. All tests are passing, nevertheless, check if my last fix makes sense.
https://github.com/sheredom/utf8.h/issues/109