'libs/audiographer' - Use 'alloca()' for a stack based array whose size is unknown...
authorJohn Emmas <johne53@tiscali.co.uk>
Thu, 5 Sep 2013 08:18:30 +0000 (09:18 +0100)
committerJohn Emmas <johne53@tiscali.co.uk>
Thu, 5 Sep 2013 08:18:30 +0000 (09:18 +0100)
libs/audiographer/src/general/broadcast_info.cc

index 43e5008e5212c49ffaf89e4f6997b2cbeb392645..df69ac9c79df618a07f4891f0193824b1e67b98f 100644 (file)
@@ -34,7 +34,7 @@ namespace AudioGrapher
 static void
 snprintf_bounded_null_filled (char* target, size_t target_size, char const * fmt, ...)
 {
-       char buf[target_size+1];
+       char *buf = (char*)alloca(target_size+1);
        va_list ap;
 
        va_start (ap, fmt);