[Tux4kids-commits] r21 - in tuxmath/trunk: docs src

dbruce at alioth.debian.org dbruce at alioth.debian.org
Thu Mar 8 21:04:05 CET 2007


Author: dbruce
Date: 2006-08-13 19:53:36 +0000 (Sun, 13 Aug 2006)
New Revision: 21

Modified:
   tuxmath/trunk/docs/changelog
   tuxmath/trunk/src/config.c
   tuxmath/trunk/src/mathcards.c
   tuxmath/trunk/src/setup.c
   tuxmath/trunk/src/setup.h
   tuxmath/trunk/src/tuxmath.c
Log:
Small but critical bug fix.


Modified: tuxmath/trunk/docs/changelog
===================================================================
--- tuxmath/trunk/docs/changelog	2006-08-11 16:27:38 UTC (rev 20)
+++ tuxmath/trunk/docs/changelog	2006-08-13 19:53:36 UTC (rev 21)
@@ -1,5 +1,14 @@
 changelog for "tuxmath"
 
+2006.Aug.13 (https://svn.tux4kids.net/tuxmath/ - revision 19)
+  Version 0.91
+
+  Code:
+    * Fixed embarrassing bug in revision 18/version 0.9 that 
+      caused program to crash with segmentation fault if 
+      TUXMATH_DEBUG disabled (which was how it was committed).
+      :^(
+
 2006.Aug.11 (https://svn.tux4kids.net/tuxmath/ - revision 18)
   Version 0.9 
 

Modified: tuxmath/trunk/src/config.c
===================================================================
--- tuxmath/trunk/src/config.c	2006-08-11 16:27:38 UTC (rev 20)
+++ tuxmath/trunk/src/config.c	2006-08-13 19:53:36 UTC (rev 21)
@@ -104,13 +104,14 @@
     /* set value to first '=' in line: */
     value = strchr(buf, '=');
 
-    #ifdef TUXMATH_DEBUG
     if (!value || (value == buf))
     {
+      #ifdef TUXMATH_DEBUG
       fprintf(stderr, "Error while reading prefs - line with no '='!\n");
+      #endif
+
       continue;
     }
-    #endif
 
     /* move past '=' sign: */
     ++value;
@@ -136,7 +137,6 @@
     #ifdef TUXMATH_DEBUG
     printf("parameter = '%s'\t, length = %d\n", parameter, strlen(parameter));
     printf("value = '%s'\t, length = %d\t, atoi() = %d\n", value, strlen(value), atoi(value));
-
     #endif
 
     /* Now ready to handle each name/value pair! */

Modified: tuxmath/trunk/src/mathcards.c
===================================================================
--- tuxmath/trunk/src/mathcards.c	2006-08-11 16:27:38 UTC (rev 20)
+++ tuxmath/trunk/src/mathcards.c	2006-08-13 19:53:36 UTC (rev 21)
@@ -1882,9 +1882,11 @@
 /* prints struct to file */
 void MC_PrintMathOptions(FILE* fp, int verbose)
 {
-  printf("\nprint_math_options():\n");
+  #ifdef MC_DEBUG
+  printf("\nEntering MC_PrintMathOptions()\n");
+  #endif
 
- /* bail out if no struct */
+  /* bail out if no struct */
   if (!math_opts)
   {
     fprintf(stderr, "\nMath Options struct does not exist!\n");

Modified: tuxmath/trunk/src/setup.c
===================================================================
--- tuxmath/trunk/src/setup.c	2006-08-11 16:27:38 UTC (rev 20)
+++ tuxmath/trunk/src/setup.c	2006-08-13 19:53:36 UTC (rev 21)
@@ -39,15 +39,14 @@
 
 #include <SDL_image.h>
 
+#include "tuxmath.h"
 #include "mathcards.h"
-
 #include "setup.h"
 #include "images.h"
 #include "sounds.h"
 #include "config.h"
 #include "game.h"
 
-
 static char * image_filenames[NUM_IMAGES] = {
   DATA_PREFIX "/images/status/standby.png",
   DATA_PREFIX "/images/status/loading.png",
@@ -178,6 +177,7 @@
 /* (These need to be 'extern'd in "setup.h") */
 SDL_Surface * screen;
 SDL_Surface * images[NUM_IMAGES];
+
 #ifndef NOSOUND
 Mix_Chunk * sounds[NUM_SOUNDS];
 Mix_Music * musics[NUM_MUSICS];

Modified: tuxmath/trunk/src/setup.h
===================================================================
--- tuxmath/trunk/src/setup.h	2006-08-11 16:27:38 UTC (rev 20)
+++ tuxmath/trunk/src/setup.h	2006-08-13 19:53:36 UTC (rev 21)
@@ -28,8 +28,8 @@
 #endif
 
 #include "game.h"
-#include "tuxmath.h"
 
+
 extern SDL_Surface * screen;
 extern SDL_Surface * images[];
 #ifndef NOSOUND

Modified: tuxmath/trunk/src/tuxmath.c
===================================================================
--- tuxmath/trunk/src/tuxmath.c	2006-08-11 16:27:38 UTC (rev 20)
+++ tuxmath/trunk/src/tuxmath.c	2006-08-13 19:53:36 UTC (rev 21)
@@ -19,21 +19,20 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#include "tuxmath.h"
 #include "setup.h"
 #include "title.h"
 #include "game.h"
 #include "options.h"
 #include "credits.h"
-#include "tuxmath.h"
 
+
 /* global data: */
-/*MC_Options* math_options;  used by setup.c, options.c, game.c */
 game_option_type* game_options; /* used by setup.c, options.c, game.c */
 
 int main(int argc, char * argv[])
 {
   int cmd, done;
-
   setup(argc, argv);
   
   done = 0;




More information about the Tux4kids-commits mailing list