Merge remote-tracking branch 'origin/topic/dnthayer/ticket1863'

* origin/topic/dnthayer/ticket1863:
  Fix ASCII logging of very large values of type "double"
  Add more test cases to ascii-double.bro
This commit is contained in:
Robin Sommer 2017-11-17 15:11:22 -08:00
commit 44baf1b355
4 changed files with 107 additions and 13 deletions

View file

@ -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);