diff tests/plrtest.c @ 793:21ad08cdf408

Fix a potential NULL pointer usage.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 18 Oct 2013 14:31:12 +0300
parents ed60a7ee3ebb
children 319792b2af4a
line wrap: on
line diff
--- a/tests/plrtest.c	Thu Aug 15 14:09:18 2013 +0300
+++ b/tests/plrtest.c	Fri Oct 18 14:31:12 2013 +0300
@@ -219,7 +219,7 @@
     BOOL playing = TRUE;
     while (playing)
     {
-        JSSPattern *pattern;
+        JSSPattern *pattern = NULL;
         int currRow, prevRow;
 
         JSS_LOCK(plr);
@@ -236,7 +236,7 @@
             SDL_Delay(50);
         }
 
-        if (playing)
+        if (playing && pattern != NULL)
         {
             printRow(stdout, pattern, currRow);
             printf("\n");