From 006b4fb4beb661aede245ab8e1f4f75c37dad597 Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Sat, 30 Apr 2005 09:25:18 +0000 Subject: Change internals of FILE: reuse the unget buffer field to access an extended attribute data structure (pimpl idiom). Idea taken from citrus. Much discussion with deraadt@, otto@, millert@... This is the least disruptive way to extend FILE, since its size can't really change without this being a flag day. So the size doesn't change. Actual additions to the structure will come in separate steps, since this change is nasty enough on its own. Tests by otto@ and others, careful reading of code by otto@ and millert@. This is definitely a major bump, and has been checked to not impact a full ports build. --- lib/libc/stdio/vsprintf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/libc/stdio/vsprintf.c') diff --git a/lib/libc/stdio/vsprintf.c b/lib/libc/stdio/vsprintf.c index 8e4b6809127..958a12e8b67 100644 --- a/lib/libc/stdio/vsprintf.c +++ b/lib/libc/stdio/vsprintf.c @@ -31,11 +31,12 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: vsprintf.c,v 1.9 2004/09/28 18:12:44 otto Exp $"; +static char rcsid[] = "$OpenBSD: vsprintf.c,v 1.10 2005/04/30 09:25:17 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include +#include "local.h" #if defined(APIWARN) __warn_references(vsprintf, @@ -47,7 +48,9 @@ vsprintf(char *str, const char *fmt, _BSD_VA_LIST_ ap) { int ret; FILE f; + struct __sfileext fext; + _FILEEXT_SETUP(&f, &fext); f._file = -1; f._flags = __SWR | __SSTR; f._bf._base = f._p = (unsigned char *)str; -- cgit v1.2.3