]> granicus.if.org Git - php/commit
Avoid using floating point arithmetic and rely on safe_emalloc
authorSascha Schumann <sas@php.net>
Sun, 7 Mar 2004 22:35:26 +0000 (22:35 +0000)
committerSascha Schumann <sas@php.net>
Sun, 7 Mar 2004 22:35:26 +0000 (22:35 +0000)
commit048e66b2a9b0ce089b15920618044a3834feb276
treed2070e926c1c417250ef85c3f9f471be59d90f54
parent70757063a7cca44d333c9d6c209bb676d0d35eb4
Avoid using floating point arithmetic and rely on safe_emalloc
for the multiplication.

The actual size requirement is spelled out as:

** The result is written into a preallocated output buffer "out".
** "out" must be able to hold at least 2 +(257*n)/254 bytes.
** In other words, the output will be expanded by as much as 3
** bytes for every 254 bytes of input plus 2 bytes of fixed overhead.
** (This is approximately 2 + 1.0118*n or about a 1.2% size increase.)
ext/sqlite/sess_sqlite.c