tp->timestamp = line_timestamp;
tp->altitude = line_altitude;
if (line_extended) {
- tp->extended = TRUE;
tp->speed = line_speed;
tp->course = line_course;
tp->nsats = line_sat;
tp->fix_mode = line_fix;
}
- else {
- tp->extended = FALSE;
- }
current_track->trackpoints = g_list_append ( current_track->trackpoints, tp );
}
}
else if (key_len == 8 && strncasecmp( key, "latitude", key_len ) == 0 && value != NULL)
{
- line_latlon.lat = g_strtod(value, NULL);
+ line_latlon.lat = g_ascii_strtod(value, NULL);
}
else if (key_len == 9 && strncasecmp( key, "longitude", key_len ) == 0 && value != NULL)
{
- line_latlon.lon = g_strtod(value, NULL);
+ line_latlon.lon = g_ascii_strtod(value, NULL);
}
else if (key_len == 8 && strncasecmp( key, "altitude", key_len ) == 0 && value != NULL)
{
- line_altitude = g_strtod(value, NULL);
+ 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 == 8 && strncasecmp( key, "unixtime", key_len ) == 0 && value != NULL)
{
- line_timestamp = g_strtod(value, NULL);
+ line_timestamp = g_ascii_strtod(value, NULL);
if ( line_timestamp != 0x80000000 )
line_has_timestamp = TRUE;
}
}
else if (key_len == 5 && strncasecmp( key, "speed", key_len ) == 0 && value != NULL)
{
- line_speed = g_strtod(value, NULL);
+ line_speed = g_ascii_strtod(value, NULL);
}
else if (key_len == 6 && strncasecmp( key, "course", key_len ) == 0 && value != NULL)
{
- line_course = g_strtod(value, NULL);
+ line_course = g_ascii_strtod(value, NULL);
}
else if (key_len == 3 && strncasecmp( key, "sat", key_len ) == 0 && value != NULL)
{
if ( tp->newsegment )
fprintf ( f, " newsegment=\"yes\"" );
- if (tp->extended) {
+ if (!isnan(tp->speed) || !isnan(tp->course) || tp->nsats > 0) {
fprintf ( f, " extended=\"yes\"" );
if (!isnan(tp->speed)) {
gchar *s_speed = a_coords_dtostr(tp->speed);