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:
parent
c4c7f13966
commit
7d79436443
|
@ -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>
|
2006-11-29 Eric Blake <ebb9@byu.net>
|
||||||
|
|
||||||
* libc/stdio/fvwrite.c (__sfvwrite_r): Avoid off-by-one error in
|
* libc/stdio/fvwrite.c (__sfvwrite_r): Avoid off-by-one error in
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
#include <sys/unistd.h>
|
#include <sys/unistd.h>
|
||||||
#include "local.h"
|
#include "local.h"
|
||||||
|
|
||||||
|
#define _DEFAULT_ASPRINTF_BUFSIZE 64
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Allocate a file buffer, or switch to unbuffered I/O.
|
* Allocate a file buffer, or switch to unbuffered I/O.
|
||||||
* Per the ANSI C standard, ALL tty devices default to line buffered.
|
* Per the ANSI C standard, ALL tty devices default to line buffered.
|
||||||
|
@ -53,7 +55,11 @@ _DEFUN(__smakebuf, (fp),
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
couldbetty = 0;
|
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() */
|
/* do not try to optimise fseek() */
|
||||||
fp->_flags |= __SNPT;
|
fp->_flags |= __SNPT;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue