Skip to content

Commit

Permalink
enforce idempotency
Browse files Browse the repository at this point in the history
bug reported by Clemens
  • Loading branch information
NikolajBjorner committed Sep 15, 2021
1 parent c58b2f4 commit 50375df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/zstring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ std::string zstring::encode() const {
#define _flush() if (offset > 0) { buffer[offset] = 0; strm << buffer; offset = 0; }
for (unsigned i = 0; i < m_buffer.size(); ++i) {
unsigned ch = m_buffer[i];
if (ch < 32 || ch >= 128) {
if (ch < 32 || ch >= 128 || ('\\' == ch && i + 1 < m_buffer.size() && 'u' == m_buffer[i+1])) {
_flush();
strm << "\\u{" << std::hex << ch << std::dec << "}";
}
Expand Down

0 comments on commit 50375df

Please sign in to comment.