mirror of
				https://github.com/tmux/tmux.git
				synced 2025-10-26 12:27:15 +00:00 
			
		
		
		
	Update imsg*.[ch] from OpenBSD, add some compat bits it needs and remove some
bits it doesn't.
This commit is contained in:
		| @@ -1,4 +1,4 @@ | ||||
| /*	$OpenBSD: imsg-buffer.c,v 1.7 2015/07/12 18:40:49 nicm Exp $	*/ | ||||
| /*	$OpenBSD: imsg-buffer.c,v 1.9 2017/03/17 14:51:26 deraadt Exp $	*/ | ||||
|  | ||||
| /* | ||||
|  * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> | ||||
| @@ -78,7 +78,7 @@ ibuf_realloc(struct ibuf *buf, size_t len) | ||||
| 		return (-1); | ||||
| 	} | ||||
|  | ||||
| 	b = realloc(buf->buf, buf->wpos + len); | ||||
| 	b = recallocarray(buf->buf, buf->size, buf->wpos + len, 1); | ||||
| 	if (b == NULL) | ||||
| 		return (-1); | ||||
| 	buf->buf = b; | ||||
| @@ -180,6 +180,8 @@ again: | ||||
| void | ||||
| ibuf_free(struct ibuf *buf) | ||||
| { | ||||
| 	if (buf == NULL) | ||||
| 		return; | ||||
| 	free(buf->buf); | ||||
| 	free(buf); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Nicholas Marriott
					Nicholas Marriott