Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2006-11-30 03:35:57 +0300
committerJeff Johnston <jjohnstn@redhat.com>2006-11-30 03:35:57 +0300
commit7d794364439c77f23403eaa09169ca8884bfe091 (patch)
tree85348bc3a8926f337d05c5516ed11a6f48a0a28c /newlib/libc/stdio
parentc4c7f13966ecbc0d4047a51fc49720b82cd6c291 (diff)
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')
-rw-r--r--newlib/libc/stdio/makebuf.c8
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;
}