=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/status.c,v retrieving revision 1.115 retrieving revision 1.116 diff -c -r1.115 -r1.116 *** src/usr.bin/tmux/status.c 2014/10/02 10:39:43 1.115 --- src/usr.bin/tmux/status.c 2014/10/08 17:35:58 1.116 *************** *** 1,4 **** ! /* $OpenBSD: status.c,v 1.115 2014/10/02 10:39:43 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: status.c,v 1.116 2014/10/08 17:35:58 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 992,998 **** /* Insert the new word. */ size += strlen(s); off = first - c->prompt_buffer; ! c->prompt_buffer = xrealloc(c->prompt_buffer, 1, size + 1); first = c->prompt_buffer + off; memmove(first + strlen(s), first, n); memcpy(first, s, strlen(s)); --- 992,998 ---- /* Insert the new word. */ size += strlen(s); off = first - c->prompt_buffer; ! c->prompt_buffer = xrealloc(c->prompt_buffer, size + 1); first = c->prompt_buffer + off; memmove(first + strlen(s), first, n); memcpy(first, s, strlen(s)); *************** *** 1170,1176 **** break; } ! c->prompt_buffer = xrealloc(c->prompt_buffer, 1, size + n + 1); if (c->prompt_index == size) { memcpy(c->prompt_buffer + c->prompt_index, pb->data, n); c->prompt_index += n; --- 1170,1176 ---- break; } ! c->prompt_buffer = xrealloc(c->prompt_buffer, size + n + 1); if (c->prompt_index == size) { memcpy(c->prompt_buffer + c->prompt_index, pb->data, n); c->prompt_index += n; *************** *** 1210,1216 **** case MODEKEY_OTHER: if ((key & 0xff00) != 0 || key < 32 || key == 127) break; ! c->prompt_buffer = xrealloc(c->prompt_buffer, 1, size + 2); if (c->prompt_index == size) { c->prompt_buffer[c->prompt_index++] = key; --- 1210,1216 ---- case MODEKEY_OTHER: if ((key & 0xff00) != 0 || key < 32 || key == 127) break; ! c->prompt_buffer = xrealloc(c->prompt_buffer, size + 2); if (c->prompt_index == size) { c->prompt_buffer[c->prompt_index++] = key;