diff options
| author | Kristian Evers <kristianevers@gmail.com> | 2018-05-06 17:43:26 +0300 |
|---|---|---|
| committer | Kristian Evers <kristianevers@gmail.com> | 2018-05-08 09:16:07 +0200 |
| commit | 58cbb9fe4f89b9febd780f7bdcfa4c2bb74a723e (patch) | |
| tree | dec50c945b01d09c5cf94d0665a6996e2d34ae5d /src/proj_etmerc.c | |
| parent | 8fef2126f1c9fa17b79e6669f4457c299c0e33bf (diff) | |
| download | PROJ-58cbb9fe4f89b9febd780f7bdcfa4c2bb74a723e.tar.gz PROJ-58cbb9fe4f89b9febd780f7bdcfa4c2bb74a723e.zip | |
Replace int typecasts with calls to lround to avoid bad conversions on NaN input. Added test to check for those cases.
Diffstat (limited to 'src/proj_etmerc.c')
| -rw-r--r-- | src/proj_etmerc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/proj_etmerc.c b/src/proj_etmerc.c index 9a89e2b0..a4088ad9 100644 --- a/src/proj_etmerc.c +++ b/src/proj_etmerc.c @@ -310,7 +310,7 @@ PJ *PROJECTION(etmerc) { PJ *PROJECTION(utm) { - int zone; + long zone; struct pj_opaque *Q = pj_calloc (1, sizeof (struct pj_opaque)); if (0==Q) return pj_default_destructor (P, ENOMEM); @@ -337,7 +337,7 @@ PJ *PROJECTION(utm) { } else /* nearest central meridian input */ { - zone = (int)(floor ((adjlon (P->lam0) + M_PI) * 30. / M_PI)); + zone = lround((floor ((adjlon (P->lam0) + M_PI) * 30. / M_PI))); if (zone < 0) zone = 0; else if (zone >= 60) |
