From 56a070ad99ad787063b4d40dbdf58bf1a5640ff1 Mon Sep 17 00:00:00 2001 From: ceriel Date: Wed, 3 Aug 1988 19:24:55 +0000 Subject: [PATCH] fixed --- lang/cem/libcc/stdio/doprnt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cem/libcc/stdio/doprnt.c b/lang/cem/libcc/stdio/doprnt.c index 3640aa49e..9e5516c33 100644 --- a/lang/cem/libcc/stdio/doprnt.c +++ b/lang/cem/libcc/stdio/doprnt.c @@ -221,7 +221,7 @@ _doprnt(fmt,ap,stream) case 'g': if (ndigit >= sizeof(buf)) ndigit = sizeof(buf) - 1; dbl = va_arg(ap, double); - s = gcvt(dbl, ndigit+1, s) + strlen(s); + s = gcvt(dbl, ndigit ? ndigit+1 : 6, s) + strlen(s); break; #endif case 'r':