Merge branch 'obsd-master'

Conflicts:
	Makefile
	cmd-list-commands.c
	cmd-suspend-client.c
	job.c
	tmux.h
	xmalloc.c
This commit is contained in:
Thomas Adam
2014-10-21 07:11:44 +01:00
100 changed files with 432 additions and 757 deletions

View File

@ -17,6 +17,7 @@
*/
#include <sys/types.h>
#include <sys/param.h>
#include <ctype.h>
#include <errno.h>
@ -267,7 +268,7 @@ format_replace(struct format_tree *ft, const char *key, size_t keylen,
/* Expand the buffer and copy in the value. */
while (*len - *off < valuelen + 1) {
*buf = xrealloc(*buf, 2, *len);
*buf = xreallocarray(*buf, 2, *len);
*len *= 2;
}
memcpy(*buf + *off, value, valuelen);
@ -298,7 +299,7 @@ format_expand(struct format_tree *ft, const char *fmt)
while (*fmt != '\0') {
if (*fmt != '#') {
while (len - off < 2) {
buf = xrealloc(buf, 2, len);
buf = xreallocarray(buf, 2, len);
len *= 2;
}
buf[off++] = *fmt++;
@ -326,7 +327,7 @@ format_expand(struct format_tree *ft, const char *fmt)
continue;
case '#':
while (len - off < 2) {
buf = xrealloc(buf, 2, len);
buf = xreallocarray(buf, 2, len);
len *= 2;
}
buf[off++] = '#';
@ -339,7 +340,7 @@ format_expand(struct format_tree *ft, const char *fmt)
s = format_lower[ch - 'a'];
if (s == NULL) {
while (len - off < 3) {
buf = xrealloc(buf, 2, len);
buf = xreallocarray(buf, 2, len);
len *= 2;
}
buf[off++] = '#';