*
* 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)
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
Altitude = alt_feet;
ls_geod_to_geoc( Latitude, Altitude, &Sea_level_radius, &Lat_geocentric);
Radius_to_vehicle = Altitude + Sea_level_radius;
+
+ return 0;
}
/* 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.
+ *
* Revision 1.4 2001/03/24 05:03:12 curt
* SG-ified logstream.
*