Fixed buffer overflow buglet (test/commands/bignum.sh crashed on gcc-2.95 )
authorJohn Darrington <john@darrington.wattle.id.au>
Tue, 17 May 2005 13:53:38 +0000 (13:53 +0000)
committerJohn Darrington <john@darrington.wattle.id.au>
Tue, 17 May 2005 13:53:38 +0000 (13:53 +0000)
src/data-out.c

index 5fce84f6c433b1075db40d5af774ec98eaedfca0..d21d2902e1e5fcfe383b0872c1dabed27ef75c88 100644 (file)
@@ -1042,7 +1042,7 @@ try_F (char *dst, const struct fmt_spec *fp, double number)
               /* There are no decimal places, so there's no way
                  that the value can be shortened.  Either it fits
                  or it doesn't. */
-              char buf[40];
+              char buf[41];
               sprintf (buf, "%*.0f", fp->w, number);
               if (strlen (buf) <= fp->w) 
                 {