Re: [PATCH 3/5] Add strbuf_printf() to do formatted printing to a strbuf.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kristian Høgsberg <krh@xxxxxxxxxx> writes:

> +static void inline strbuf_grow(struct strbuf *sb, size_t extra)
> +{
> +	while (sb->alloc < sb->len + extra)
>  		sb->alloc = sb->alloc * 3 / 2 + 16;
> +	sb->buf = xrealloc(sb->buf, sb->alloc);
> +}

Somehow this while () loop to compute the growth factor bothers
me but that is probably a minor detail.

> +void strbuf_printf(struct strbuf *sb, const char *fmt, ...)
> +{
> +	char one_line[2048];
> +	va_list args;
> +	int len;

Such a nice abstraction so far, and then at the highest level of
callchain we have this hardcoded limit?

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux