From 245397491afead4bd2a6d79ceb89dcff3f963e84 Mon Sep 17 00:00:00 2001 From: ceriel Date: Thu, 22 Oct 1987 13:35:05 +0000 Subject: [PATCH] increased buffer size, check for end --- lang/cem/libcc/stdio/doprnt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lang/cem/libcc/stdio/doprnt.c b/lang/cem/libcc/stdio/doprnt.c index 99304b242..ab6ddc03b 100644 --- a/lang/cem/libcc/stdio/doprnt.c +++ b/lang/cem/libcc/stdio/doprnt.c @@ -95,7 +95,7 @@ _doprnt(fmt,args,stream) unsigned int uint ; register int j ; int i,c,rjust,width,ndigit,ndfnd,zfill; - char *oldfmt,*s1,buf[40]; + char *oldfmt,*s1,buf[129]; nextarg = args; while (c = *fmt++) { @@ -216,10 +216,12 @@ _doprnt(fmt,args,stream) break; #ifndef NOFLOAT case 'e': + if (ndigit >= sizeof(buf)) ndigit = sizeof(buf) - 1; geta(&dbl,wsize(dbl)) ; s = _pscien(dbl,s,ndigit,ndfnd); break; case 'f': + if (ndigit >= sizeof(buf)) ndigit = sizeof(buf) - 1; geta(&dbl,wsize(dbl)) ; s = _pfloat(dbl,s,ndigit,ndfnd); break;