=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/window-copy.c,v retrieving revision 1.115 retrieving revision 1.116 diff -c -r1.115 -r1.116 *** src/usr.bin/tmux/window-copy.c 2014/10/02 08:36:26 1.115 --- src/usr.bin/tmux/window-copy.c 2014/10/08 17:35:58 1.116 *************** *** 1,4 **** ! /* $OpenBSD: window-copy.c,v 1.115 2014/10/02 08:36:26 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: window-copy.c,v 1.116 2014/10/08 17:35:58 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 794,800 **** } inputlen = strlen(data->inputstr); ! data->inputstr = xrealloc(data->inputstr, 1, inputlen + n + 1); memcpy(data->inputstr + inputlen, pb->data, n); data->inputstr[inputlen + n] = '\0'; break; --- 794,800 ---- } inputlen = strlen(data->inputstr); ! data->inputstr = xrealloc(data->inputstr, inputlen + n + 1); memcpy(data->inputstr + inputlen, pb->data, n); data->inputstr[inputlen + n] = '\0'; break; *************** *** 840,846 **** break; inputlen = strlen(data->inputstr) + 2; ! data->inputstr = xrealloc(data->inputstr, 1, inputlen); data->inputstr[inputlen - 2] = key; data->inputstr[inputlen - 1] = '\0'; break; --- 840,846 ---- break; inputlen = strlen(data->inputstr) + 2; ! data->inputstr = xrealloc(data->inputstr, inputlen); data->inputstr[inputlen - 2] = key; data->inputstr[inputlen - 1] = '\0'; break; *************** *** 1533,1539 **** } else pb = paste_get_name(bufname); if (pb != NULL) { ! buf = xrealloc(buf, 1, len + pb->size); memmove(buf + pb->size, buf, len); memcpy(buf, pb->data, pb->size); len += pb->size; --- 1533,1539 ---- } else pb = paste_get_name(bufname); if (pb != NULL) { ! buf = xrealloc(buf, len + pb->size); memmove(buf + pb->size, buf, len); memcpy(buf, pb->data, pb->size); len += pb->size; *************** *** 1589,1595 **** } } ! *buf = xrealloc(*buf, 1, (*off) + ud.size); memcpy(*buf + *off, ud.data, ud.size); *off += ud.size; } --- 1589,1595 ---- } } ! *buf = xrealloc(*buf, (*off) + ud.size); memcpy(*buf + *off, ud.data, ud.size); *off += ud.size; } *************** *** 1597,1603 **** /* Only add a newline if the line wasn't wrapped. */ if (!wrapped || ex != xx) { ! *buf = xrealloc(*buf, 1, (*off) + 1); (*buf)[(*off)++] = '\n'; } } --- 1597,1603 ---- /* Only add a newline if the line wasn't wrapped. */ if (!wrapped || ex != xx) { ! *buf = xrealloc(*buf, (*off) + 1); (*buf)[(*off)++] = '\n'; } }