return DOWNLOAD_NOT_REQUIRED;
}
- if (options->check_file_server_time) {
+ if (options != NULL && options->check_file_server_time) {
file_options.time_condition = file_time;
}
- if (options->use_etag) {
+ if (options != NULL && options->use_etag) {
gchar *etag_filename = g_strdup_printf("%s.etag", fn);
gsize etag_length = 0;
g_file_get_contents (etag_filename, &(file_options.etag), &etag_length, NULL);
g_remove ( tmpfilename );
unlock_file ( tmpfilename );
g_free ( tmpfilename );
- if (options->use_etag) {
+ if ( options != NULL && options->use_etag ) {
g_free ( file_options.etag );
g_free ( file_options.new_etag );
}
return result;
}
- if ( options->convert_file )
- options->convert_file ( tmpfilename );
+ if ( options != NULL && options->convert_file )
+ options->convert_file ( tmpfilename );
- if (options->use_etag) {
+ if ( options != NULL && options->use_etag ) {
if (file_options.new_etag) {
/* server returned an etag value */
gchar *etag_filename = g_strdup_printf("%s.etag", fn);
unlock_file ( tmpfilename );
g_free ( tmpfilename );
- if (options->use_etag) {
+ if ( options != NULL && options->use_etag ) {
g_free ( file_options.etag );
g_free ( file_options.new_etag );
}
{
line_altitude = g_ascii_strtod(value, NULL);
}
- else if (key_len == 7 && strncasecmp( key, "visible", key_len ) == 0 && value[0] != 'y' && value[0] != 'Y' && value[0] != 't' && value[0] != 'T')
+ else if (key_len == 7 && strncasecmp( key, "visible", key_len ) == 0 && value != NULL && value[0] != 'y' && value[0] != 'Y' && value[0] != 't' && value[0] != 'T')
{
line_visible = FALSE;
}
{
static struct LatLon ll;
gchar *s_lat, *s_lon;
- // Sanity clause
- if ( wp && !(wp->name) ) {
+ // Sanity clauses
+ if ( !wp )
return;
- }
+ if ( !(wp->name) )
+ return;
+
vik_coord_to_latlon ( &(wp->coord), &ll );
s_lat = a_coords_dtostr(ll.lat);
s_lon = a_coords_dtostr(ll.lon);