summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/vfprintf.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1997-12-24 23:02:47 +0000
committerache <ache@FreeBSD.org>1997-12-24 23:02:47 +0000
commitd6bcc605a0dda1fae5485a69235f91b7eaa17666 (patch)
treef4c404b45a764f364d855cd1dc1c90f8a1eec66c /lib/libc/stdio/vfprintf.c
parent7bbce1048f6b1d616d9d1a7a290a7e91f36e5e8b (diff)
downloadFreeBSD-src-d6bcc605a0dda1fae5485a69235f91b7eaa17666.zip
FreeBSD-src-d6bcc605a0dda1fae5485a69235f91b7eaa17666.tar.gz
Return back to BSD snprintf semantics which recent C9x standard adopts
instead of Singe Unix, thanx Bruce for explaining, I am not realize standards war was there. But now, fix n == 0 case to not return error and fix check for too big n. Things left to do: check for overflow in arguments.
Diffstat (limited to 'lib/libc/stdio/vfprintf.c')
-rw-r--r--lib/libc/stdio/vfprintf.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c
index 4abdbc4..3457c86 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.13 1997/12/19 21:59:22 bde Exp $";
+ "$Id: vfprintf.c,v 1.14 1997/12/24 13:47:13 ache Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -643,18 +643,14 @@ 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 *) = n;
+ *GETARG(quad_t *) = ret;
else if (flags & LONGINT)
- *GETARG(long *) = n;
+ *GETARG(long *) = ret;
else if (flags & SHORTINT)
- *GETARG(short *) = n;
+ *GETARG(short *) = ret;
else
- *GETARG(int *) = n;
+ *GETARG(int *) = ret;
continue; /* no output */
case 'O':
flags |= LONGINT;
OpenPOWER on IntegriCloud