Blame SOURCES/ghostscript-trio-g.patch
|
|
ea5d11 |
diff -up ghostscript-9.07/trio/trio.c~ ghostscript-9.07/trio/trio.c
|
|
|
ea5d11 |
--- ghostscript-9.07/trio/trio.c~ 2014-05-14 16:44:46.390090859 +0100
|
|
|
ea5d11 |
+++ ghostscript-9.07/trio/trio.c 2014-05-14 17:52:24.247609272 +0100
|
|
|
ea5d11 |
@@ -3172,6 +3172,9 @@ TRIO_ARGS6((self, number, flags, width,
|
|
|
ea5d11 |
if (integerNumber > epsilon)
|
|
|
ea5d11 |
{
|
|
|
ea5d11 |
integerDigits += (int)TrioLogarithm(integerNumber, base);
|
|
|
ea5d11 |
+ /* Deal with the dangers of casting long double to int */
|
|
|
ea5d11 |
+ if (integerNumber - TrioPower (base, integerDigits) >= 0)
|
|
|
ea5d11 |
+ integerDigits++;
|
|
|
ea5d11 |
}
|
|
|
ea5d11 |
|
|
|
ea5d11 |
fractionDigits = precision;
|
|
|
ea5d11 |
@@ -3255,6 +3258,11 @@ TRIO_ARGS6((self, number, flags, width,
|
|
|
ea5d11 |
integerDigits = (integerNumber > epsilon)
|
|
|
ea5d11 |
? 1 + (int)TrioLogarithm(integerNumber, base)
|
|
|
ea5d11 |
: 1;
|
|
|
ea5d11 |
+
|
|
|
ea5d11 |
+ /* Deal with the dangers of casting long double to int */
|
|
|
ea5d11 |
+ if (integerNumber - TrioPower (base, integerDigits) >= 0)
|
|
|
ea5d11 |
+ integerDigits++;
|
|
|
ea5d11 |
+
|
|
|
ea5d11 |
if (flags & FLAGS_FLOAT_G)
|
|
|
ea5d11 |
{
|
|
|
ea5d11 |
if (flags & FLAGS_ALTERNATIVE)
|