diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2006-11-30 00:35:57 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2006-11-30 00:35:57 +0000 |
commit | 7d794364439c77f23403eaa09169ca8884bfe091 (patch) | |
tree | 85348bc3a8926f337d05c5516ed11a6f48a0a28c /newlib/libc/stdio/makebuf.c | |
parent | c4c7f13966ecbc0d4047a51fc49720b82cd6c291 (diff) | |
download | cygnal-7d794364439c77f23403eaa09169ca8884bfe091.tar.gz cygnal-7d794364439c77f23403eaa09169ca8884bfe091.tar.bz2 cygnal-7d794364439c77f23403eaa09169ca8884bfe091.zip |
2006-11-29 Jeff Johnston <jjohnstn@redhat.com>
* libc/stdio/makebuf.c (__smakebuf): If dealing with
an asprintf-family buffer, make the default initial size 64.
Diffstat (limited to 'newlib/libc/stdio/makebuf.c')
-rw-r--r-- | newlib/libc/stdio/makebuf.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/newlib/libc/stdio/makebuf.c b/newlib/libc/stdio/makebuf.c index c4d03ecb6..9808cd5ec 100644 --- a/newlib/libc/stdio/makebuf.c +++ b/newlib/libc/stdio/makebuf.c @@ -24,6 +24,8 @@ #include <sys/unistd.h> #include "local.h" +#define _DEFAULT_ASPRINTF_BUFSIZE 64 + /* * Allocate a file buffer, or switch to unbuffered I/O. * Per the ANSI C standard, ALL tty devices default to line buffered. @@ -53,7 +55,11 @@ _DEFUN(__smakebuf, (fp), #endif { couldbetty = 0; - size = BUFSIZ; + /* Check if we are be called by asprintf family for initial buffer. */ + if (fp->_flags & __SMBF) + size = _DEFAULT_ASPRINTF_BUFSIZE; + else + size = BUFSIZ; /* do not try to optimise fseek() */ fp->_flags |= __SNPT; } |