[Tux4kids-commits] r962 - tuxmath/trunk/src

Michał Świtakowski swistakers-guest at alioth.debian.org
Thu Apr 23 18:29:31 UTC 2009


Author: swistakers-guest
Date: 2009-04-23 18:29:31 +0000 (Thu, 23 Apr 2009)
New Revision: 962

Modified:
   tuxmath/trunk/src/tuxmathadmin.c
Log:
bugfixes to tuxmathadmin

Modified: tuxmath/trunk/src/tuxmathadmin.c
===================================================================
--- tuxmath/trunk/src/tuxmathadmin.c	2009-04-23 12:10:42 UTC (rev 961)
+++ tuxmath/trunk/src/tuxmathadmin.c	2009-04-23 18:29:31 UTC (rev 962)
@@ -104,6 +104,7 @@
   fp = fopen(DATA_PREFIX "/missions/options", "r");
   if (fp) {
     extract_variable(fp,"homedir",&path);
+    free(path);
     fclose(fp);
   }
 
@@ -249,8 +250,6 @@
     clear_logs(path);
   }
 
-  free(path);
-
   return EXIT_SUCCESS;
 }
 
@@ -357,7 +356,7 @@
     // Count the number of levels by counting the commas + 1
     this_line_total_depth = 1;
     line_cur = line_begin;
-    while (!(*line_cur == '\r' || *line_cur == '\n')) {
+    while (!(*line_cur == '\r' || *line_cur == '\n' || *line_cur == '\0')) {
       if (*line_cur == ',')
         this_line_total_depth++;
       line_cur++;




More information about the Tux4kids-commits mailing list