From 0cc697c0faf31ac553c5c9b56a8a04bbbc61cea7 Mon Sep 17 00:00:00 2001 From: tecodev Date: Tue, 10 Feb 2009 22:47:27 +0000 Subject: [PATCH] device/lib/pic16/libc/stdio/vsprintf.c: enlarge buffer for x_ftoa() git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5373 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 4 ++-- device/lib/pic16/libc/stdio/vfprintf.c | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7b016c58..ee45364b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,7 @@ * support/regression/tests/float_single.c: added regression test. Some testpoints for probably rarely used functions - (acosf, sinhf, tanf, expf) disabled for some targets + (acosf, sinhf, tanf, expf) disabled for some targets 2008-02-10 Raphael Neider @@ -27,7 +27,7 @@ * device/lib/pic16/libc/stdio/sprintf.c, device/lib/pic16/libc/stdio/vsprintf.c: do not mess up the user's - pointer to the string buffer + pointer to the string buffer, enlarge buffer for x_ftoa() 2008-02-10 Borut Razem diff --git a/device/lib/pic16/libc/stdio/vfprintf.c b/device/lib/pic16/libc/stdio/vfprintf.c index fc243343..3d3137cc 100644 --- a/device/lib/pic16/libc/stdio/vfprintf.c +++ b/device/lib/pic16/libc/stdio/vfprintf.c @@ -139,7 +139,11 @@ */ #define EXTRA_INTEGER -#ifdef BINARY_SPECIFIER +#if defined(USE_FLOATS) +/* x_ftoa requires up to 8 digits (integral part) + '.' + 24 digits + * (fractional part). Adding a sign and a NUL byte yields 35 byte. */ +# define BUF_SIZE 36 +#elif defined(BINARY_SPECIFIER) /* "%lb" = "0" - "11111111111111111111111111111111" */ # define BUF_SIZE 33 #else -- 2.30.2