From eaa5bbf4b8703e3794943f27d3fb9c1265dfd418 Mon Sep 17 00:00:00 2001 From: hunt Date: Tue, 30 Jan 2007 19:18:06 +0000 Subject: 2007-01-30 Martin Hunt * io.c (_stp_vlog): Use dynamic percpu allocations instead of very wasteful static allocations. * print.c (_stp_print_init): Do percpu allocations for io.c. (_stp_print_cleanup): Free percpu allocations. * string.c (_stp_sprintf): Overflow check needed to be >= instead of >. --- runtime/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/string.c') diff --git a/runtime/string.c b/runtime/string.c index 6615d741..b740c064 100644 --- a/runtime/string.c +++ b/runtime/string.c @@ -64,7 +64,7 @@ void _stp_sprintf (String str, const char *fmt, ...) va_start(args, fmt); num = _stp_vsnprintf(buf, size, fmt, args); va_end(args); - if (unlikely(num > size)) { + if (unlikely(num >= size)) { /* overflowed the buffer */ if (pb->len == 0) { /* A single print request exceeded the buffer size. */ -- cgit