aboutsummaryrefslogtreecommitdiffstats
path: root/vsnprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'vsnprintf.c')
-rw-r--r--vsnprintf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/vsnprintf.c b/vsnprintf.c
index a1ac4424a2..1f53bc4265 100644
--- a/vsnprintf.c
+++ b/vsnprintf.c
@@ -829,6 +829,9 @@ fp_begin: _double = va_arg(ap, double);
--expt;
expsize = exponent(expstr, expt, ch + 'p' - 'a');
size = expsize + ndig;
+ size += 2; /* 0x */
+ if (ndig > 1)
+ ++size; /* floating point */
}
else if (ch <= 'e') { /* 'e' or 'E' fmt */
--expt;