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.
This commit is contained in:
Jeff Johnston 2006-11-30 00:35:57 +00:00
parent c4c7f13966
commit 7d79436443
2 changed files with 12 additions and 1 deletions

View File

@ -1,3 +1,8 @@
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.
2006-11-29 Eric Blake <ebb9@byu.net>
* libc/stdio/fvwrite.c (__sfvwrite_r): Avoid off-by-one error in

View File

@ -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;
}