# HG changeset patch # User John Tsiombikas # Date 1442547658 -10800 # Node ID 00f98842608ff384bb57b46d815fd50764ac5d33 # Parent 1ff87789079b22cec0ebc675f2df29ea1fca3c05 dtx_vprintf diff -r 1ff87789079b -r 00f98842608f src/drawgl.c --- a/src/drawgl.c Thu Sep 11 21:47:12 2014 +0300 +++ b/src/drawgl.c Fri Sep 18 06:40:58 2015 +0300 @@ -169,6 +169,14 @@ void dtx_printf(const char *fmt, ...) { va_list ap; + + va_start(ap, fmt); + dtx_vprintf(fmt, ap); + va_end(ap); +} + +void dtx_vprintf(const char *fmt, va_list ap) +{ int buf_size; char *buf, tmp; @@ -176,9 +184,7 @@ return; } - va_start(ap, fmt); buf_size = vsnprintf(&tmp, 0, fmt, ap); - va_end(ap); if(buf_size == -1) { buf_size = 512;