From 55f68c36574779ae2fac3652466584628b22c633 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 12 Feb 2011 16:54:24 +0000 Subject: fix for more warnings. - modifier code was using sizeof() without knowing the sizeof the array when clearing the modifier type array. - use BLI_snprintf rather then sprintf where the size of the string is known. - particle drawing code kept a reference to stack float values (not a problem at the moment but would crash if accessed later). --- intern/guardedalloc/intern/mallocn.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'intern/guardedalloc') diff --git a/intern/guardedalloc/intern/mallocn.c b/intern/guardedalloc/intern/mallocn.c index 83aceb12344..27170439a53 100644 --- a/intern/guardedalloc/intern/mallocn.c +++ b/intern/guardedalloc/intern/mallocn.c @@ -167,12 +167,13 @@ static int malloc_debug_memset= 0; static void print_error(const char *str, ...) { - char buf[1024]; + char buf[512]; va_list ap; va_start(ap, str); - vsprintf(buf, str, ap); + vsnprintf(buf, sizeof(buf), str, ap); va_end(ap); + buf[sizeof(buf) - 1] = '\0'; if (error_callback) error_callback(buf); } -- cgit v1.2.3