changeset 200:b842cc92c787

No need for dynamic allocation here, I think.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 07 Oct 2012 07:53:42 +0300
parents 623e58df95c1
children 844f38cbff65
files dmtext_bm.c
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/dmtext_bm.c	Sun Oct 07 07:02:20 2012 +0300
+++ b/dmtext_bm.c	Sun Oct 07 07:53:42 2012 +0300
@@ -33,12 +33,10 @@
 
 void dmDrawBMTextVA(SDL_Surface *screen, DMBitmapFont *font, int mode, int xc, int yc, const char *fmt, va_list ap)
 {
-    char *tmp = dm_strdup_vprintf(fmt, ap);
-    if (tmp != NULL)
-    {
-        dmDrawBMTextConst(screen, font, mode, xc, yc, tmp);
-        dmFree(tmp);
-    }
+    char tmp[512];
+    vsnprintf(tmp, sizeof(tmp), fmt, ap);
+    dmDrawBMTextConst(screen, font, mode, xc, yc, tmp);
+    dmFree(tmp);
 }