mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Fix ASCII logging of very large values of type "double"
Increased the size of a buffer to be large enough to contain all the characters of the largest possible "double" value when scientific notation is not being used (previously, the nonsensical "NAN.0" would be written to ASCII logs for any value >= 1e248).
This commit is contained in:
parent
aee307f02b
commit
6e89505d06
2 changed files with 7 additions and 5 deletions
|
@ -145,7 +145,9 @@ void ODesc::Add(double d, bool no_exp)
|
|||
AddBytes(&d, sizeof(d));
|
||||
else
|
||||
{
|
||||
char tmp[256];
|
||||
// Buffer needs enough chars to store max. possible "double" value
|
||||
// of 1.79e308 without using scientific notation.
|
||||
char tmp[350];
|
||||
|
||||
if ( no_exp )
|
||||
modp_dtoa3(d, tmp, sizeof(tmp), IsReadable() ? 6 : 8);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue