summaryrefslogtreecommitdiff
path: root/main/spprintf.c
diff options
context:
space:
mode:
authorJakub Zelenka <bukka@php.net>2016-06-26 14:03:01 +0100
committerJakub Zelenka <bukka@php.net>2016-06-26 14:03:01 +0100
commit3f13507dd281adf0518c9162dce5391e9250e93b (patch)
tree70f4addc37de995e1a58e5baec180e0ef266a937 /main/spprintf.c
parent158b537c99ca5fc7846e7d16d532644be95894a7 (diff)
downloadphp-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.c8
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')