[Hopefully] fix a line ending problem that surfaces in MSVC.

This commit is contained in:
curt
2001-12-09 03:54:46 +00:00
parent c8570302f5
commit 35ab6900ee
2 changed files with 148 additions and 0 deletions
+8
View File
@@ -290,6 +290,14 @@ void SGTime::updateLocal( double lon, double lat, const string& root ) {
delete ptr;
}
zonename = strdup( zone.c_str() );
//Avoid troubles when zone.tab hasn't got the right line endings
if (zonename[strlen(zonename)-1] == '\r')
{
zonename[strlen(zonename)-1]=0;
zone.set( zonename );
}
currGMT = sgTimeGetGMT( gmtime(&cur_time) );
aircraftLocalTime = sgTimeGetGMT( (fgLocaltime(&cur_time, zone.c_str())) );
local_offset = aircraftLocalTime - currGMT;