diff options
author | Bram Moolenaar <Bram@vim.org> | 2012-06-01 15:21:02 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2012-06-01 15:21:02 +0200 |
commit | 9a920d8c31bc4d267d8790ba0d83b5774316e08f (patch) | |
tree | 9e3efd2be89a848c17b76251486cf14da09c7e9b /src/mbyte.c | |
parent | 704984ac87979fd20b8ba732df3abd3197814f7f (diff) | |
download | vim-git-9a920d8c31bc4d267d8790ba0d83b5774316e08f.tar.gz |
updated for version 7.3.535v7.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.
Diffstat (limited to 'src/mbyte.c')
-rw-r--r-- | src/mbyte.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mbyte.c b/src/mbyte.c index 75b41ead9..23944018f 100644 --- a/src/mbyte.c +++ b/src/mbyte.c @@ -708,7 +708,7 @@ codepage_invalid: */ n = (i & 0x80) ? 2 : 1; # else - char buf[MB_MAXBYTES]; + char buf[MB_MAXBYTES + 1]; # ifdef X_LOCALE # ifndef mblen # define mblen _Xmblen @@ -1953,7 +1953,7 @@ utfc_ptr2char_len(p, pcc, maxlen) /* * Convert the character at screen position "off" to a sequence of bytes. * Includes the composing characters. - * "buf" must at least have the length MB_MAXBYTES. + * "buf" must at least have the length MB_MAXBYTES + 1. * Only to be used when ScreenLinesUC[off] != 0. * Returns the produced number of bytes. */ |