summaryrefslogtreecommitdiff
path: root/sci-astronomy/stellarium/files/stellarium-0.22.1-fix-conv.patch
blob: 5187837fbb615bc5ddc42936c20d2b9b7f386a21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From dd65fdf5a332d62834ac1cfe9639e220ea635c55 Mon Sep 17 00:00:00 2001
From: "Alexander V. Wolf" <alex.v.wolf@gmail.com>
Date: Wed, 25 May 2022 20:55:15 +0700
Subject: [PATCH] Fixed conversion tool radToHms(): avoiding possible negative
 zero for value of seconds (see #2460)

---
 src/core/StelUtils.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/StelUtils.cpp b/src/core/StelUtils.cpp
index 93a55ebb957..b03f55a68ec 100644
--- a/src/core/StelUtils.cpp
+++ b/src/core/StelUtils.cpp
@@ -140,7 +140,7 @@ void radToHms(double angle, unsigned int& h, unsigned int& m, double& s)
 
 	h = static_cast<unsigned int>(angle);
 	m = static_cast<unsigned int>((angle-h)*60);
-	s = (angle-h)*3600.-60.*m;	
+	s = qAbs((angle-h)*3600.-60.*m);
 }
 
 /*************************************************************************