diff options
author | Zufu Liu <unknown> | 2021-07-03 14:47:54 +1000 |
---|---|---|
committer | Zufu Liu <unknown> | 2021-07-03 14:47:54 +1000 |
commit | 67d41ce2237e39ea3be7932659fe04f263c82b24 (patch) | |
tree | 5883fd367b299b34c0c65f0e4cba80353af28996 /src/Editor.cxx | |
parent | a2d23bd463e65f532301b682b64cd02b8a57716b (diff) | |
download | scintilla-mirror-67d41ce2237e39ea3be7932659fe04f263c82b24.tar.gz |
Feature [feature-requests:#1408] Avoid sprintf for hexadecimal character blobs.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r-- | src/Editor.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 71aaeae53..d01eb0cdf 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -247,8 +247,8 @@ void Editor::SetRepresentations() { if (IsUnicodeMode()) { for (int k=0x80; k < 0x100; k++) { const char hiByte[2] = { static_cast<char>(k), 0 }; - char hexits[5]; // Really only needs 4 but that causes warning from gcc 7.1 - sprintf(hexits, "x%2X", k); + char hexits[4]; + Hexits(hexits, k); reprs.SetRepresentation(hiByte, hexits); } } else if (pdoc->dbcsCodePage) { @@ -257,8 +257,8 @@ void Editor::SetRepresentations() { const char ch = static_cast<char>(k); if (pdoc->IsDBCSLeadByteNoExcept(ch) || pdoc->IsDBCSLeadByteInvalid(ch)) { const char hiByte[2] = { ch, 0 }; - char hexits[5]; // Really only needs 4 but that causes warning from gcc 7.1 - sprintf(hexits, "x%2X", k); + char hexits[4]; + Hexits(hexits, k); reprs.SetRepresentation(hiByte, hexits); } } |