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 f93bc39774
commit 94734aacc6

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; max = *pos >= bufsize ? 0 : bufsize - *pos;
va_start(ap, fmt); va_start(ap, fmt);
result = rb_vsnprintf(buf + *pos, bufsize - *pos, fmt, ap); result = rb_vsnprintf(buf + *pos, max, fmt, ap);
va_end(ap); va_end(ap);
*pos += result; *pos += result;
} }