diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2015-07-07 18:46:36 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2015-07-07 18:46:36 +0200 |
| commit | 2b5b97942016c2f18a0992b934d1b6b460391dac (patch) | |
| tree | 46cffbdad4a652422cc94f6077e3ab3955e6dc0f /src/pj_utils.c | |
| parent | 396afc3312243ff4a8e95c3b9398d56c5582e30d (diff) | |
| download | PROJ-2b5b97942016c2f18a0992b934d1b6b460391dac.tar.gz PROJ-2b5b97942016c2f18a0992b934d1b6b460391dac.zip | |
Make pj_init() locale safe and no longer modify locale (#226)
Remove setlocale() use in pj_init_ctx(), and replace uses of atof() &
strtod() by their locale safe variants pj_atof() and pj_strtod().
Proj versions from now advertize #define PJ_LOCALE_SAFE 1 in proj_api.h
and export pj_atof() & pj_strtod()
Diffstat (limited to 'src/pj_utils.c')
| -rw-r--r-- | src/pj_utils.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/pj_utils.c b/src/pj_utils.c index bb4b6ae6..f11081fc 100644 --- a/src/pj_utils.c +++ b/src/pj_utils.c @@ -101,8 +101,15 @@ PJ *pj_latlong_from_proj( PJ *pj_in ) sprintf( defn+strlen(defn), " +f=%s", pj_param(pj_in->ctx,pj_in->params,"sf").s ); else - sprintf( defn+strlen(defn), " +es=%.16g", - pj_in->es ); + { + char* ptr = defn+strlen(defn); + sprintf( ptr, " +es=%.16g", pj_in->es ); + for(; *ptr; ptr++) + { + if( *ptr == ',' ) + *ptr = '.'; + } + } } else { |
