Mercurial > vim
diff src/screen.c @ 3549:f52d2ea0f81c v7.3.535
updated for version 7.3.535
Problem: Many #ifdefs for MB_MAXBYTES.
Solution: Also define MB_MAXBYTES without the +multi_byte feature. Fix
places where the buffer didn't include space for a NUL byte.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Fri, 01 Jun 2012 15:21:02 +0200 |
parents | 3db4282d5e6b |
children | 0a364618c0e5 |
line wrap: on
line diff
--- a/src/screen.c +++ b/src/screen.c @@ -6621,16 +6621,17 @@ screen_putchar(c, row, col, attr) int row, col; int attr; { + char_u buf[MB_MAXBYTES + 1]; + #ifdef FEAT_MBYTE - char_u buf[MB_MAXBYTES + 1]; - - buf[(*mb_char2bytes)(c, buf)] = NUL; -#else - char_u buf[2]; - - buf[0] = c; - buf[1] = NUL; -#endif + if (has_mbyte) + buf[(*mb_char2bytes)(c, buf)] = NUL; + else +#endif + { + buf[0] = c; + buf[1] = NUL; + } screen_puts(buf, row, col, attr); }