diff options
author | Jakub Zelenka <bukka@php.net> | 2016-06-26 14:03:01 +0100 |
---|---|---|
committer | Jakub Zelenka <bukka@php.net> | 2016-06-26 14:03:01 +0100 |
commit | 3f13507dd281adf0518c9162dce5391e9250e93b (patch) | |
tree | 70f4addc37de995e1a58e5baec180e0ef266a937 /main/spprintf.c | |
parent | 158b537c99ca5fc7846e7d16d532644be95894a7 (diff) | |
download | php-git-3f13507dd281adf0518c9162dce5391e9250e93b.tar.gz |
Use one place to define max length of double
Introduce new constant PHP_DOUBLE_MAX_LENGTH for that purpose
Diffstat (limited to 'main/spprintf.c')
-rw-r--r-- | main/spprintf.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/main/spprintf.c b/main/spprintf.c index cac4210dfb..73a5ff52e3 100644 --- a/main/spprintf.c +++ b/main/spprintf.c @@ -152,13 +152,9 @@ /* * NUM_BUF_SIZE is the size of the buffer used for arithmetic conversions - * - * XXX: this is a magic number; do not decrease it - * Emax = 1023 - * NDIG = 320 - * NUM_BUF_SIZE >= strlen("-") + Emax + strlrn(".") + NDIG + strlen("E+1023") + 1; + * which can be at most max length of double */ -#define NUM_BUF_SIZE 2048 +#define NUM_BUF_SIZE PHP_DOUBLE_MAX_LENGTH #define NUM(c) (c - '0') |