diff options
| author | Jeff Garzik <jeff@garzik.org> | 2006-03-20 04:38:03 -0500 |
|---|---|---|
| committer | Jeff Garzik <jeff@garzik.org> | 2006-03-20 04:38:03 -0500 |
| commit | d378aca6ec708bfb24df5c47801b1f2399efc481 (patch) | |
| tree | 7535f96bf34314df071698d2e06054b8d5223ebb /scripts | |
| parent | abc71c46dc0a12ab7fddc18cfe4f4aa26808c79b (diff) | |
| parent | 7705a8792b0fc82fd7d4dd923724606bbfd9fb20 (diff) | |
Merge branch 'master'
Diffstat (limited to 'scripts')
| -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 f70ff13d4818..b8b2a560b26b 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
| @@ -508,12 +508,7 @@ buf_printf(struct buffer *buf, const char *fmt, ...) | |||
| 508 | 508 | ||
| 509 | va_start(ap, fmt); | 509 | va_start(ap, fmt); |
| 510 | len = vsnprintf(tmp, SZ, fmt, ap); | 510 | len = vsnprintf(tmp, SZ, fmt, ap); |
| 511 | if (buf->size - buf->pos < len + 1) { | 511 | buf_write(buf, tmp, len); |
| 512 | buf->size += 128; | ||
| 513 | buf->p = realloc(buf->p, buf->size); | ||
| 514 | } | ||
| 515 | strncpy(buf->p + buf->pos, tmp, len + 1); | ||
| 516 | buf->pos += len; | ||
| 517 | va_end(ap); | 512 | va_end(ap); |
| 518 | } | 513 | } |
| 519 | 514 | ||
| @@ -521,7 +516,7 @@ void | |||
| 521 | buf_write(struct buffer *buf, const char *s, int len) | 516 | buf_write(struct buffer *buf, const char *s, int len) |
| 522 | { | 517 | { |
| 523 | if (buf->size - buf->pos < len) { | 518 | if (buf->size - buf->pos < len) { |
| 524 | buf->size += len; | 519 | buf->size += len + SZ; |
| 525 | buf->p = realloc(buf->p, buf->size); | 520 | buf->p = realloc(buf->p, buf->size); |
| 526 | } | 521 | } |
| 527 | strncpy(buf->p + buf->pos, s, len); | 522 | strncpy(buf->p + buf->pos, s, len); |
