[Debian-astro-commits] [gyoto] 218/221: Fix Disk3D::repeatPhi() to avoid SIGFPE when nphi_ is 0

Thibaut Jean-Claude Paumard thibaut at moszumanska.debian.org
Fri May 22 20:52:48 UTC 2015


This is an automated email from the git hooks/post-receive script.

thibaut pushed a commit to branch master
in repository gyoto.

commit 11c4faa047b9eb172281c62ff366e9bf741d0831
Author: Thibaut Paumard <paumard at users.sourceforge.net>
Date:   Fri May 22 12:07:06 2015 +0200

    Fix Disk3D::repeatPhi() to avoid SIGFPE when nphi_ is 0
---
 lib/Disk3D.C | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Disk3D.C b/lib/Disk3D.C
index 9ab5913..dd6cf9e 100644
--- a/lib/Disk3D.C
+++ b/lib/Disk3D.C
@@ -219,7 +219,7 @@ double const * Disk3D::getVelocity() const { return velocity_; }
 
 void Disk3D::repeatPhi(size_t n) {
   repeat_phi_ = n;
-  if ((nphi_-1)*repeat_phi_>0.)
+  if (nphi_>1 && repeat_phi_>0.)
     dphi_=(phimax_-phimin_)/double((nphi_-1)*repeat_phi_);
     //dphi_=2.*M_PI/double((nphi_-1.)*repeat_phi_);
     

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-astro/packages/gyoto.git



More information about the Debian-astro-commits mailing list