diff options
Diffstat (limited to 'src/xdisp.c')
-rw-r--r-- | src/xdisp.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index d44e677eeb7..b64a2c0cf6c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10384,17 +10384,14 @@ static void store_mode_line_noprop_char (char c) { /* If output position has reached the end of the allocated buffer, - double the buffer's size. */ + increase the buffer's size. */ if (mode_line_noprop_ptr == mode_line_noprop_buf_end) { ptrdiff_t len = MODE_LINE_NOPROP_LEN (0); - ptrdiff_t new_size; - - if (STRING_BYTES_BOUND / 2 < len) - memory_full (SIZE_MAX); - new_size = 2 * len; - mode_line_noprop_buf = (char *) xrealloc (mode_line_noprop_buf, new_size); - mode_line_noprop_buf_end = mode_line_noprop_buf + new_size; + ptrdiff_t size = len; + mode_line_noprop_buf = + xpalloc (mode_line_noprop_buf, &size, 1, STRING_BYTES_BOUND, 1); + mode_line_noprop_buf_end = mode_line_noprop_buf + size; mode_line_noprop_ptr = mode_line_noprop_buf + len; } |