gcvt was called with wrong precision
authorceriel <none@none>
Thu, 4 Aug 1988 15:48:20 +0000 (15:48 +0000)
committerceriel <none@none>
Thu, 4 Aug 1988 15:48:20 +0000 (15:48 +0000)
lang/cem/libcc/stdio/doprnt.c

index 9e5516c..55f0e2f 100644 (file)
@@ -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 ? ndigit+1 : 6, s) + strlen(s);
+                       s = gcvt(dbl, ndigit ? ndigit : 6, s) + strlen(s);
                        break;
 #endif
                case 'r':