aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mod/file2alias.c2
-rw-r--r--scripts/mod/modpost.c9
2 files changed, 3 insertions, 8 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index be97caf664bb..c164b230ad6f 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -246,7 +246,7 @@ static int do_ccw_entry(const char *filename,
246 id->cu_model); 246 id->cu_model);
247 ADD(alias, "dt", id->match_flags&CCW_DEVICE_ID_MATCH_DEVICE_TYPE, 247 ADD(alias, "dt", id->match_flags&CCW_DEVICE_ID_MATCH_DEVICE_TYPE,
248 id->dev_type); 248 id->dev_type);
249 ADD(alias, "dm", id->match_flags&CCW_DEVICE_ID_MATCH_DEVICE_TYPE, 249 ADD(alias, "dm", id->match_flags&CCW_DEVICE_ID_MATCH_DEVICE_MODEL,
250 id->dev_model); 250 id->dev_model);
251 return 1; 251 return 1;
252} 252}
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
521buf_write(struct buffer *buf, const char *s, int len) 516buf_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);