From 3f13507dd281adf0518c9162dce5391e9250e93b Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Sun, 26 Jun 2016 14:03:01 +0100 Subject: Use one place to define max length of double Introduce new constant PHP_DOUBLE_MAX_LENGTH for that purpose --- main/spprintf.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'main/spprintf.c') 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') -- cgit v1.2.1