Correct WHOX overflow check so it also works for fields other than the last.

Found with llvm static analyzer.
This commit is contained in:
Jilles Tjoelker 2009-03-01 01:58:53 +01:00
parent a6210c453a
commit 8fc0a9b621
1 changed files with 1 additions and 1 deletions

View File

@ -442,7 +442,7 @@ append_format(char *buf, size_t bufsize, size_t *pos, const char *fmt, ...)
max = *pos >= bufsize ? 0 : bufsize - *pos;
va_start(ap, fmt);
result = rb_vsnprintf(buf + *pos, bufsize - *pos, fmt, ap);
result = rb_vsnprintf(buf + *pos, max, fmt, ap);
va_end(ap);
*pos += result;
}