Protected against buffer overflow (and resulting crash) that occurred when displaying the luminosity of stars with very high absolute magnitudes.
parent
3c3425ef60
commit
2168046eb3
|
@ -2710,7 +2710,9 @@ static void displayStarInfo(Overlay& overlay,
|
|||
star.getAbsoluteMagnitude(),
|
||||
astro::absToAppMag(star.getAbsoluteMagnitude(),
|
||||
(float) distance));
|
||||
overlay << "Luminosity: " << SigDigitNum(star.getLuminosity(), 3) << "x Sun\n";
|
||||
|
||||
if (star.getLuminosity() > 1.0e-10f)
|
||||
overlay << "Luminosity: " << SigDigitNum(star.getLuminosity(), 3) << "x Sun\n";
|
||||
overlay << "Class: ";
|
||||
if (star.getSpectralType()[0] == 'Q')
|
||||
overlay << "Neutron star";
|
||||
|
|
Loading…
Reference in New Issue