Skip to content

Commit 5d88748

Browse files
committed
No divide by zero, thanks
1 parent 91ab330 commit 5d88748

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/app/qgsoptions.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,8 +1207,8 @@ void QgsOptions::populateEllipsoidList()
12071207

12081208
myItem.acronym = GEO_NONE;
12091209
myItem.description = tr( GEO_NONE_DESC );
1210-
myItem.semiMajor = 1 / 0.0; // Should return +Inf
1211-
myItem.semiMinor = 1 / 0.0; // Should reutrn +Inf;
1210+
myItem.semiMajor = 0.0;
1211+
myItem.semiMinor = 0.0;
12121212
mEllipsoidList.append( myItem );
12131213

12141214
myItem.acronym = QString( "PARAMETER:6370997:6370997" );
@@ -1256,7 +1256,7 @@ void QgsOptions::populateEllipsoidList()
12561256
else if ( para2.left( 3 ) == "rf=" )
12571257
{
12581258
double invFlattening = para2.mid( 3 ).toDouble();
1259-
if ( invFlattening > 0.0 )
1259+
if ( invFlattening != 0.0 )
12601260
{
12611261
myItem.semiMinor = myItem.semiMajor - ( myItem.semiMajor / invFlattening );
12621262
}

0 commit comments

Comments
 (0)