buf = malloc(6 * n + 10);
buf = malloc(5 * n + 10);
static void dump_pollfds(int n, int r){	char *buf, *b;	int i;	buf = malloc(6 * n + 10);	if (buf == 0)		return;	if (r == 0) {		b = buf + sprintf(buf, "fds:     ");		for (i = 0; i < n; i++)			b += sprintf(b, " %5d", pollfds[i].fd);		log_d(buf);		b = buf + sprintf(buf, "events:  ");		for (i = 0; i < n; i++)			b += sprintf(b, " %5hd", pollfds[i].events);		log_d(buf);	} else {		b = buf + sprintf(buf, "revents: ");		for (i = 0; i < n; i++)			b += sprintf(b, " %5hd", pollfds[i].revents);		log_d(buf);	}	free(buf);}