vsprintf.c (92986) | vsprintf.c (101776) |
---|---|
1/*- 2 * Copyright (c) 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Chris Torek. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 24 unchanged lines hidden (view full) --- 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 */ 36 37#if defined(LIBC_SCCS) && !defined(lint) 38static char sccsid[] = "@(#)vsprintf.c 8.1 (Berkeley) 6/4/93"; 39#endif /* LIBC_SCCS and not lint */ 40#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Chris Torek. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 24 unchanged lines hidden (view full) --- 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 */ 36 37#if defined(LIBC_SCCS) && !defined(lint) 38static char sccsid[] = "@(#)vsprintf.c 8.1 (Berkeley) 6/4/93"; 39#endif /* LIBC_SCCS and not lint */ 40#include <sys/cdefs.h> |
41__FBSDID("$FreeBSD: head/lib/libc/stdio/vsprintf.c 92986 2002-03-22 21:53:29Z obrien $"); | 41__FBSDID("$FreeBSD: head/lib/libc/stdio/vsprintf.c 101776 2002-08-13 09:30:41Z tjr $"); |
42 43#include <stdio.h> 44#include <limits.h> 45#include "local.h" 46 47int 48vsprintf(str, fmt, ap) 49 char *str; 50 const char *fmt; 51 _BSD_VA_LIST_ ap; 52{ 53 int ret; 54 FILE f; | 42 43#include <stdio.h> 44#include <limits.h> 45#include "local.h" 46 47int 48vsprintf(str, fmt, ap) 49 char *str; 50 const char *fmt; 51 _BSD_VA_LIST_ ap; 52{ 53 int ret; 54 FILE f; |
55 struct __sFILEX ext; |
|
55 56 f._file = -1; 57 f._flags = __SWR | __SSTR; 58 f._bf._base = f._p = (unsigned char *)str; 59 f._bf._size = f._w = INT_MAX; | 56 57 f._file = -1; 58 f._flags = __SWR | __SSTR; 59 f._bf._base = f._p = (unsigned char *)str; 60 f._bf._size = f._w = INT_MAX; |
61 f._extra = &ext; 62 INITEXTRA(&f); |
|
60 ret = __vfprintf(&f, fmt, ap); 61 *f._p = 0; 62 return (ret); 63} | 63 ret = __vfprintf(&f, fmt, ap); 64 *f._p = 0; 65 return (ret); 66} |