On Sun Nov 20 15:06:27 2022 +0000, Nikolay Sivov wrote:
I don't follow, why is this not the same situation as with write_escaped_string() with explicit length? Why do you have to check for (*pwch && cwch) and not just (cwch)?
Write_escaped_string with explicit length basically writes everything including the terminating `'\0'` which gets rejected by writer_get_next_count with WC_E_XMLCHARACTER basically achieving the same result. In the case of WriteRaw() and WriteRawChars() the terminating `'\0'` never actually gets written.
I check both *pwch and cwch because we are writing a particular number of characters which yes, might equal the characters in the string or may not be equal.
Edit : Checking for *pwch allows us to catch a possible error where user tried to write more characters than are in the provided string