diff --git a/src/switch_apr.c b/src/switch_apr.c index 52ee2372e5..61c5031909 100644 --- a/src/switch_apr.c +++ b/src/switch_apr.c @@ -653,13 +653,13 @@ SWITCH_DECLARE(int) switch_vasprintf(char **buf, const char *format, va_list ap) data.vbuff.endpos = data.buf + data.block_size; return apr_vformatter(vasprintf_flush, (apr_vformatter_buff_t *)&data, format, ap); -#endif -#ifdef HAVE_VASPRINTF - return vasprintf(buf, format, ap); -#else - *buf = (char *) malloc(2048); - return vsnprintf(*buf, 2048, format, ap); -#endif +#endif +#ifdef HAVE_VASPRINTF + return vasprintf(buf, format, ap); +#else + *buf = (char *) malloc(2048); + return vsnprintf(*buf, 2048, format, ap); +#endif }