diff options
Diffstat (limited to 'src/EditView.cxx')
-rw-r--r-- | src/EditView.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx index a71f385e7..e4b0fa5d9 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -170,6 +170,13 @@ void DrawStyledText(Surface *surface, const ViewStyle &vs, int styleOffset, PRec } } +void Hexits(char *hexits, int ch) noexcept { + hexits[0] = 'x'; + hexits[1] = "0123456789ABCDEF"[ch / 0x10]; + hexits[2] = "0123456789ABCDEF"[ch % 0x10]; + hexits[3] = 0; +} + } EditView::EditView() { @@ -1040,7 +1047,7 @@ void EditView::DrawEOL(Surface *surface, const EditModel &model, const ViewStyle if (UTF8IsAscii(chEOL)) { ctrlChar = ControlCharacterString(chEOL); } else { - sprintf(hexits, "x%2X", chEOL); + Hexits(hexits, chEOL); ctrlChar = hexits; } } |