[Gpredict-svn] SF.net SVN: gpredict:[887] trunk
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
|
From: <aa...@us...> - 2011-08-21 13:40:29
|
Revision: 887
http://gpredict.svn.sourceforge.net/gpredict/?rev=887&view=rev
Author: aa1vs
Date: 2011-08-21 13:40:23 +0000 (Sun, 21 Aug 2011)
Log Message:
-----------
Eliminates memory leak and cut and paste error and removes whitespace around tle before importing.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/tle-update.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2011-08-20 21:24:50 UTC (rev 886)
+++ trunk/ChangeLog 2011-08-21 13:40:23 UTC (rev 887)
@@ -1,3 +1,10 @@
+2011-08-21 Charles Suprin <hamaa1vs at gmail.com>
+
+ * ChangeLog
+ * src/tle-update.c
+ Eliminates memory leak and cut and paste error and removes whitespace around tle before importing.
+
+
2011-08-20 Charles Suprin <hamaa1vs at gmail.com>
* ChangeLog
Modified: trunk/src/tle-update.c
===================================================================
--- trunk/src/tle-update.c 2011-08-20 21:24:50 UTC (rev 886)
+++ trunk/src/tle-update.c 2011-08-21 13:40:23 UTC (rev 887)
@@ -852,6 +852,11 @@
b = fgets (tle_str[1], 80, fp);
b = fgets (tle_str[2], 80, fp);
+ /* remove leading and trailing whitespace to be more forgiving */
+ g_strstrip(tle_str[0]);
+ g_strstrip(tle_str[1]);
+ g_strstrip(tle_str[2]);
+
tle_str[1][69] = '\0';
tle_str[2][69] = '\0';
@@ -1035,7 +1040,7 @@
tlestr1 = g_key_file_get_string (satdata, "Satellite", "TLE1", NULL);
tlestr2 = g_key_file_get_string (satdata, "Satellite", "TLE2", NULL);
satname = g_key_file_get_string (satdata, "Satellite", "NAME", NULL);
- satnickname = g_key_file_get_string (satdata, "Satellite", "NAME", NULL);
+ satnickname = g_key_file_get_string (satdata, "Satellite", "NICKNAME", NULL);
rawtle = g_strconcat (tlestr1, tlestr2, NULL);
if (!Good_Elements (rawtle)) {
@@ -1048,7 +1053,10 @@
g_free (tlestr1);
g_free (tlestr2);
g_free (rawtle);
+
+ /* Initialize flag for update */
updateddata = FALSE;
+
if (ntle->satname != NULL) {
/* when a satellite first appears in the elements it is sometimes refered to by the
international designator which is awkward after it is given a name */
@@ -1069,6 +1077,10 @@
}
}
}
+
+ g_free(satname);
+ g_free(satnickname);
+
if (tle.epoch < ntle->epoch) {
/* new data is newer than what we already have */
/* store new data */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|