X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Ftiming%2Ftimezone.cxx;h=0b2e74c6c5ad0094a2fcaff6841b5c78f2a56fe8;hb=a25e859fa773c9463e4bec042b8d0b39041c29ad;hp=aac090a4466dfb4824b2a2e311758be801d012fe;hpb=51ef4568dd248a6917720a386e658610958e1512;p=simgear.git diff --git a/simgear/timing/timezone.cxx b/simgear/timing/timezone.cxx index aac090a4..0b2e74c6 100644 --- a/simgear/timing/timezone.cxx +++ b/simgear/timing/timezone.cxx @@ -12,10 +12,9 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * **************************************************************************/ @@ -30,6 +29,9 @@ #include #include #include + +#include + #include "timezone.h" SGTimeZone::SGTimeZone(float la, float lo, char* cc, char* desc) : @@ -127,8 +129,9 @@ SGTimeZoneContainer::SGTimeZoneContainer(const char *filename) char buffer[256]; FILE* infile = fopen(filename, "rb"); if (!(infile)) { - fprintf(stderr, "Unable to open file %s\n", filename); - exit(1); + string e = "Unable to open time zone file '"; + throw sg_exception(e + filename + '\''); + } else { errno = 0; @@ -152,6 +155,7 @@ SGTimeZoneContainer::SGTimeZoneContainer(const char *filename) errno = 0; } } + fclose(infile); } SGTimeZoneContainer::~SGTimeZoneContainer()