diff test/testime.c @ 4637:8c229370ddba

Fix for deleting the last uncommit character
author Jjgod Jiang <gzjjgod@gmail.com>
date Thu, 12 Aug 2010 16:00:47 +0200
parents 3e69e077cb95
children 08d22c54a21f
line wrap: on
line diff
--- a/test/testime.c	Mon Aug 16 09:04:55 2010 -0700
+++ b/test/testime.c	Thu Aug 12 16:00:47 2010 +0200
@@ -136,11 +136,13 @@
                         int x, int y,
                         SDL_Color color)
 {
-    SDL_Surface *textSur = TTF_RenderUTF8_Blended(font, text, color);
-    SDL_Rect dest = { x, y, textSur->w, textSur->h };
+    if (text && strlen(text)) {
+        SDL_Surface *textSur = TTF_RenderUTF8_Blended(font, text, color);
+        SDL_Rect dest = { x, y, textSur->w, textSur->h };
 
-    SDL_BlitSurface(textSur, NULL, sur, &dest);
-    SDL_FreeSurface(textSur);
+        SDL_BlitSurface(textSur, NULL, sur, &dest);
+        SDL_FreeSurface(textSur);
+    }
 }
 #endif