Mercurial > vim
comparison src/misc1.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 | 6c318419e331 |
children | 5c1aaf9b4b1b |
comparison
equal
deleted
inserted
replaced
3548:7a6efa56f306 | 3549:f52d2ea0f81c |
---|---|
1930 void | 1930 void |
1931 ins_char(c) | 1931 ins_char(c) |
1932 int c; | 1932 int c; |
1933 { | 1933 { |
1934 #if defined(FEAT_MBYTE) || defined(PROTO) | 1934 #if defined(FEAT_MBYTE) || defined(PROTO) |
1935 char_u buf[MB_MAXBYTES]; | 1935 char_u buf[MB_MAXBYTES + 1]; |
1936 int n; | 1936 int n; |
1937 | 1937 |
1938 n = (*mb_char2bytes)(c, buf); | 1938 n = (*mb_char2bytes)(c, buf); |
1939 | 1939 |
1940 /* When "c" is 0x100, 0x200, etc. we don't want to insert a NUL byte. | 1940 /* When "c" is 0x100, 0x200, etc. we don't want to insert a NUL byte. |