Opened 14 years ago

Last modified 14 years ago

#3775 closed defect

mitab_spatialref.cpp - default GEOCS uses atof and has locale problems, fix proposed — at Version 1

Reported by: nicolaslelong Owned by: warmerdam
Priority: normal Milestone:
Component: OGR_SRS Version: 1.7.2
Severity: normal Keywords: mitab
Cc: Daniel Morissette, aboudreault, warmerdam

Description (last modified by nicolaslelong)

In method TABFile::GetSpatialRef, on line 1037, the following statement uses atof to convert the SRS_UA_DEGREE_CONV string to double.

    m_poSpatialRef->SetGeogCS( "unnamed",
                               szDatumName,
                               pszSpheroidName,
                               dfSemiMajor, dfInvFlattening,
                               pszPMName, dfPMOffset,
                               SRS_UA_DEGREE, atof(SRS_UA_DEGREE_CONV));

This causes problems when the current locale has not "." as the decimal separator (results in 0 instead of 0.0174532925199433)

Fix ::

Simply replacing atof with CPLAtof solves the problem.

Change History (1)

comment:1 by nicolaslelong, 14 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.