]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/LaRCsim/ls_interface.c
Improve timing statistics
[flightgear.git] / src / FDM / LaRCsim / ls_interface.c
index fa38bc83d52ee92f9860cbb78ee5d9eb75d31f1f..e24b2aa82c1492f32de55f47329cf9de67c3ba02 100644 (file)
@@ -18,7 +18,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
  * $Id$
  * (Log is kept at end of this file)
@@ -292,10 +292,10 @@ void ls_stamp( void ) {
     
     nowtime_t = time( 0 );
     nowtime = localtime( &nowtime_t ); /* set fields to correct time values */
-    date = (nowtime->tm_year)*10000 
+    date = (nowtime->tm_year % 100)*10000
         + (nowtime->tm_mon + 1)*100
         + (nowtime->tm_mday);
-    sprintf(sim_control_.date_string, "%06d\0", date);
+    sprintf(sim_control_.date_string, "%06ld\0", date);
     sprintf(sim_control_.time_stamp, "%02d:%02d:%02d\0", 
        nowtime->tm_hour, nowtime->tm_min, nowtime->tm_sec);
 #ifdef COMPILE_THIS_CODE_THIS_USELESS_CODE
@@ -580,6 +580,34 @@ int ls_ForceAltitude(double alt_feet) {
 /* Flight Gear Modification Log
  *
  * $Log$
+ * Revision 1.3  2007/03/01 17:53:24  mfranz
+ * Hans Ulrich NIEDERMANN:
+ *
+ * """
+ * Fix Y2K bug triggering string overflow
+ *
+ * sim_control_.date_string is a char[7], so it can contain "yymmdd" and
+ * the terminating '\0'. However, nowtime->tm_year is 107 for the year 2007,
+ * so you'll end up with a 7 digit number and the string written to
+ * sim_control_.date_string is longer than sim_control_.date_string is.
+ * Ouch!
+ * """
+ *
+ * mf: ... and sim_control_.date_string isn't even used.
+ *
+ * Revision 1.2  2006-02-21 17:45:03  mfranz
+ * new FSF address (see http://www.gnu.org/licenses/gpl.html)
+ *
+ * Revision 1.1.1.1  2002-09-10 01:14:02  curt
+ * Initial revision of FlightGear-0.9.0
+ *
+ * Revision 1.6  2002/01/30 15:17:27  david
+ * Fixes from Cameron Moore:
+ *
+ * I've attached 3 diffs against files in FlightGear to fix some printf
+ * format strings.  The changes are pretty straight forward.  Let me know
+ * if you have any questions.  (BTW, I'm using gcc 2.95.4)
+ *
  * Revision 1.5  2001/05/21 18:44:59  curt
  * Tile pager tweaks.
  * MSVC++ tweaks.