+/*
+ * viking -- GPS Data and Topo Analyzer, Explorer, and Manager
+ *
+ * Copyright (C) 2003-2008, Evan Battaglia <gtoevan@gmx.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
#include <stdio.h>
#include <string.h>
#include <glib.h>
#include <zlib.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <unistd.h>
#include <sys/mman.h>
local_file_header = (struct _lfh *) zip_file;
if (local_file_header->sig != 0x04034b50) {
- g_warning("%s(): wrong format\n", __PRETTY_FUNCTION__);
+ g_warning("%s(): wrong format", __PRETTY_FUNCTION__);
g_free(unzip_data);
goto end;
}
else if (file_size == (num_rows_1sec * num_rows_1sec * sizeof(gint16)))
arcsec = 1;
else {
- g_warning("%s(): file %s does not have right size\n", __PRETTY_FUNCTION__, basename);
+ g_warning("%s(): file %s does not have right size", __PRETTY_FUNCTION__, basename);
munmap(dem_file, file_size);
g_ptr_array_free(dem->columns, TRUE);
g_free(dem);
const gchar *basename = a_file_basename(file);
/* FILE IO */
- f = fopen(file, "r");
+ f = g_fopen(file, "r");
if ( !f )
return NULL;
gboolean is_zip_file = (strlen(basename) == 15);
rv = vik_dem_read_srtm_hgt(f, basename, is_zip_file);
fclose(f);
+ f = NULL;
return(rv);
}
/* TODO - class C records (right now says 'Invalid' and dies) */
fclose(f);
+ f = NULL;
/* 24k scale */
if ( rv->horiz_units == VIK_DEM_HORIZ_UTM_METERS && rv->n_columns >= 2 )