From 6c8ba8e3dfa637d920ca169b7d902c7ac83539c2 Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Sat, 12 Dec 1987 20:49:37 -0800 Subject: [PATCH] printf returns number of chars processed; attach Berkeley header SCCS-vsn: lib/libc/stdio/printf.c 5.3 --- usr/src/lib/libc/stdio/printf.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/usr/src/lib/libc/stdio/printf.c b/usr/src/lib/libc/stdio/printf.c index f4bc8cda60..eb6ae97c4a 100644 --- a/usr/src/lib/libc/stdio/printf.c +++ b/usr/src/lib/libc/stdio/printf.c @@ -1,12 +1,27 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that this notice is preserved and that due credit is given + * to the University of California at Berkeley. The name of the University + * may not be used to endorse or promote products derived from this + * software without specific prior written permission. This software + * is provided ``as is'' without express or implied warranty. + */ + #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)printf.c 5.2 (Berkeley) %G%"; -#endif LIBC_SCCS and not lint +static char sccsid[] = "@(#)printf.c 5.3 (Berkeley) %G%"; +#endif /* LIBC_SCCS and not lint */ -#include +#include printf(fmt, args) -char *fmt; + char *fmt; + int args; { - _doprnt(fmt, &args, stdout); - return(ferror(stdout)? EOF: 0); + int len; + + len = _doprnt(fmt, &args, stdout); + return(ferror(stdout) ? EOF : len); } -- 2.20.1