vfprintf.c (10b3b54548f2290bbe8d8f88c59c28d12b7a635d) | vfprintf.c (1b0181df2f46ef73a41ea8c9b7026718f8eec3a1) |
---|---|
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 --- 155 unchanged lines hidden (view full) --- 164 * Helper function for `fprintf to unbuffered unix file': creates a 165 * temporary buffer. We only work on write-only files; this avoids 166 * worries about ungetc buffers and so forth. 167 */ 168static int 169__sbprintf(FILE *fp, const char *fmt, va_list ap) 170{ 171 int ret; | 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 --- 155 unchanged lines hidden (view full) --- 164 * Helper function for `fprintf to unbuffered unix file': creates a 165 * temporary buffer. We only work on write-only files; this avoids 166 * worries about ungetc buffers and so forth. 167 */ 168static int 169__sbprintf(FILE *fp, const char *fmt, va_list ap) 170{ 171 int ret; |
172 FILE fake; | 172 FILE fake = FAKE_FILE; |
173 unsigned char buf[BUFSIZ]; 174 175 /* XXX This is probably not needed. */ 176 if (prepwrite(fp) != 0) 177 return (EOF); 178 179 /* copy the important variables */ 180 fake._flags = fp->_flags & ~__SNBF; --- 842 unchanged lines hidden --- | 173 unsigned char buf[BUFSIZ]; 174 175 /* XXX This is probably not needed. */ 176 if (prepwrite(fp) != 0) 177 return (EOF); 178 179 /* copy the important variables */ 180 fake._flags = fp->_flags & ~__SNBF; --- 842 unchanged lines hidden --- |