diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-03-20 04:48:50 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-03-20 04:48:50 -0500 |
commit | 29b2548bf53ffb810394a2110161ef49f8e4780f (patch) | |
tree | af0233def65a854dc95e5faca9645b30e88d45aa /scripts/mod/modpost.c | |
parent | c39f5ebe0a542caab30c88e60623709c7bc6fe30 (diff) | |
parent | 7705a8792b0fc82fd7d4dd923724606bbfd9fb20 (diff) |
Merge branch 'master'
Diffstat (limited to 'scripts/mod/modpost.c')
-rw-r--r-- | scripts/mod/modpost.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index f70ff13d481..b8b2a560b26 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -508,12 +508,7 @@ buf_printf(struct buffer *buf, const char *fmt, ...) va_start(ap, fmt); len = vsnprintf(tmp, SZ, fmt, ap); - if (buf->size - buf->pos < len + 1) { - buf->size += 128; - buf->p = realloc(buf->p, buf->size); - } - strncpy(buf->p + buf->pos, tmp, len + 1); - buf->pos += len; + buf_write(buf, tmp, len); va_end(ap); } @@ -521,7 +516,7 @@ void buf_write(struct buffer *buf, const char *s, int len) { if (buf->size - buf->pos < len) { - buf->size += len; + buf->size += len + SZ; buf->p = realloc(buf->p, buf->size); } strncpy(buf->p + buf->pos, s, len); |