summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>1997-12-24 13:47:13 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>1997-12-24 13:47:13 +0000
commit97adcd5ba18a0fd45661a89f452986401146eb93 (patch)
treed8d4af045b72850fc16b1a263ceccd4d2dc19e6a
parenta65a537cb1aaf93c8bad3ee02fe80e05bb4ab52d (diff)
Notes
-rw-r--r--lib/libc/stdio/vfprintf.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c
index 105d7fec6fea..4abdbc4e7d28 100644
--- a/lib/libc/stdio/vfprintf.c
+++ b/lib/libc/stdio/vfprintf.c
@@ -39,7 +39,7 @@
static char sccsid[] = "@(#)vfprintf.c 8.1 (Berkeley) 6/4/93";
#endif
static const char rcsid[] =
- "$Id: vfprintf.c,v 1.12 1997/02/22 15:02:40 peter Exp $";
+ "$Id: vfprintf.c,v 1.13 1997/12/19 21:59:22 bde Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -643,14 +643,18 @@ fp_begin: if (prec == -1)
break;
#endif /* FLOATING_POINT */
case 'n':
+ n = ret;
+ if ((fp->_flags & __SSTR) &&
+ fp->_bf._size < n)
+ n = fp->_bf._size;
if (flags & QUADINT)
- *GETARG(quad_t *) = ret;
+ *GETARG(quad_t *) = n;
else if (flags & LONGINT)
- *GETARG(long *) = ret;
+ *GETARG(long *) = n;
else if (flags & SHORTINT)
- *GETARG(short *) = ret;
+ *GETARG(short *) = n;
else
- *GETARG(int *) = ret;
+ *GETARG(int *) = n;
continue; /* no output */
case 'O':
flags |= LONGINT;