From 5890bc92d41b13a99c7a3349daa9a2e2162b1ce2 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Sun, 22 Feb 1998 09:53:40 -0700 Subject: cplus-dem.c (gnu_special): Don't get confused by . strings that are not actually lengths. * cplus-dem.c (gnu_special): Don't get confused by . strings that are not actually lengths. * config/mh-cygwin32: remove vasprintf.o from EXTRA_OFILES since it gets built automatically * vasprintf.c (int_vasprintf): Increase buffer size for float/double values. From-SVN: r18171 --- libiberty/vasprintf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libiberty/vasprintf.c') diff --git a/libiberty/vasprintf.c b/libiberty/vasprintf.c index 38e8468..da83db2 100644 --- a/libiberty/vasprintf.c +++ b/libiberty/vasprintf.c @@ -74,7 +74,7 @@ int_vasprintf (result, format, args) } while (strchr ("hlL", *p)) ++p; - /* Should be big enough for any format specifier except %s. */ + /* Should be big enough for any format specifier except %s and floats. */ total_width += 30; switch (*p) { @@ -93,6 +93,9 @@ int_vasprintf (result, format, args) case 'g': case 'G': (void) va_arg (ap, double); + /* Since an ieee double can have an exponent of 307, we'll + make the buffer wide enough to cover the gross case. */ + total_width += 307; break; case 's': total_width += strlen (va_arg (ap, char *)); -- cgit v1.1