diff options
| author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-08-31 02:33:42 +0200 |
|---|---|---|
| committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-09-09 18:22:21 +0200 |
| commit | 34683e89478962874f64b06e353bb4d6b9f472ae (patch) | |
| tree | 0be336a7a4e05dc015287261352cb7b1bc288797 /src/qreg.c | |
| parent | b729ee46ebf139399f695c2443cc5a6fdbcbdbe2 (diff) | |
reserve at most 4 bytes for UTF-8 encoded characters (refs #5)
There is a widespread myth that they could take up to 6 bytes.
Diffstat (limited to 'src/qreg.c')
| -rw-r--r-- | src/qreg.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -285,7 +285,7 @@ teco_qreg_plain_get_character(teco_qreg_t *qreg, teco_int_t position, ret = FALSE; /* make sure we still restore the current Q-Register */ } else if (teco_view_ssm(teco_qreg_view, SCI_GETCODEPAGE, 0, 0) == SC_CP_UTF8) { - gchar buf[6+1]; + gchar buf[4+1]; struct Sci_TextRangeFull range = { .chrg = {off, MIN(len, off+sizeof(buf)-1)}, .lpstrText = buf |
