From: ceriel Date: Tue, 19 Mar 1991 10:25:36 +0000 (+0000) Subject: Detect too large values X-Git-Tag: release-5-5~1174 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=3e0eb5d58a58efab062ca59764a9ed6dd2e6eaf4;p=ack.git Detect too large values --- diff --git a/lang/pc/libpc/cvt.c b/lang/pc/libpc/cvt.c index 9867a6372..e53492026 100644 --- a/lang/pc/libpc/cvt.c +++ b/lang/pc/libpc/cvt.c @@ -1,6 +1,10 @@ /* $Header$ */ #ifndef NOFLOAT +#if __STDC__ +#include +#endif + static char *cvt(); #define NDIGITS 128 @@ -55,6 +59,11 @@ cvt(value, ndigit, decpt, sign, ecvtflag) } *decpt = 0; +#if __STDC__ + if (value >= DBL_MAX) { + value = DBL_MAX; + } +#endif if (value != 0.0) { register struct powers_of_10 *pp = &p10[0];