Commit graph

7 commits

Author SHA1 Message Date
Tim Wojtulewicz
96d9115360 GH-1079: Use full paths starting with zeek/ when including files 2020-11-12 12:15:26 -07:00
Jon Siwek
17e3392052 Avoid unary negation of INT64_MIN in modp_litoa10
Overlow can occur in that case, which is undefined behavior.
2020-09-18 11:32:05 -07:00
Jon Siwek
d25ead8f8e Avoid double-to-int conversion overflows in modp_dtoa functions
Those methods already had a fallback to use sprintf() for large values
except:

* The check-for-large-value was unnecessarily done after many
  operations that aren't relevant to the check and those operations can
  result in a conversion overflow (undefined behavior).

* The check-for-large-value was using the literal value for a
  32-bit INT_MAX instead of just using INT_MAX.  For a platform where
  `int` is less than 32-bits, the same conversion overflow from the
  previous point could still occur (undefined behavior).

* The check-for-large-value was not inclusive of INT_MAX.
  In a case where the conversion of INT_MAX itself to a double
  can't be represented exactly, it's implementation-defined whether
  the closest higher or closest lower representable-value is selected.
  If the higher value is selected, then a `double` value comparing equal
  to INT_MAX-as-converted-to-double would cause an overflow of an `int`
  upon conversion (undefined behavior).
2020-09-18 11:32:05 -07:00
Robin Sommer
d86bf15dbf Do not use scientific notations when printing doubles in logs.
Closes BIT-1558.
2016-05-23 16:07:22 -07:00
Robin Sommer
a24abddc5f Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Remove automatic use of gperftools on non-Linux systems.
  Fix uninitialized value for 'is_partial' in TCP analyzer.
  parse 64-bit consts correctly.
  on 32-bit machines only unsigned long longs are 64-bits long. Not just unsigned longs...
2012-08-28 16:35:06 -07:00
Bernhard Amann
26f5aee7f6 on 32-bit machines only unsigned long longs are 64-bits long. Not just unsigned longs...
Note that this means that up to now all outputs (including logs) of counts > 32 bits were broken on 32-bit systems.
2012-08-28 00:44:39 -07:00
Robin Sommer
8aaccf1c95 Logging speed improvements.
We now use Google's replacement functions for slow printf-based
num-to-ascii conversion.
2011-10-06 15:55:45 -07:00