aboutsummaryrefslogtreecommitdiff
path: root/src/PJ_cea.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/PJ_cea.c')
-rw-r--r--src/PJ_cea.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/PJ_cea.c b/src/PJ_cea.c
index f5b78838..aa544db6 100644
--- a/src/PJ_cea.c
+++ b/src/PJ_cea.c
@@ -42,9 +42,12 @@ FREEUP;
ENTRY1(cea, apa)
double t;
- if (pj_param(P->ctx, P->params, "tlat_ts").i &&
- (P->k0 = cos(t = pj_param(P->ctx, P->params, "rlat_ts").f)) < 0.)
- E_ERROR(-24);
+ if (pj_param(P->ctx, P->params, "tlat_ts").i) {
+ P->k0 = cos(t = pj_param(P->ctx, P->params, "rlat_ts").f);
+ if (P->k0 < 0.) {
+ E_ERROR(-24);
+ }
+ }
if (P->es) {
t = sin(t);
P->k0 /= sqrt(1. - P->es * t * t);