diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2006-03-15 22:38:59 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2006-03-15 22:38:59 +0000 |
commit | 490cfb83e99515e5b5573ab74d73f15c582da1b6 (patch) | |
tree | 6caa1ba58a68fcb2ecec785e893dee34a884f67c /newlib/libc/stdio/wsetup.c | |
parent | f02400f7c9db8176a7cc49eb8e4b6450ae5901c2 (diff) | |
download | newlib-490cfb83e99515e5b5573ab74d73f15c582da1b6.zip newlib-490cfb83e99515e5b5573ab74d73f15c582da1b6.tar.gz newlib-490cfb83e99515e5b5573ab74d73f15c582da1b6.tar.bz2 |
2006-03-15 Jeff Johnston <jjohnstn@redhat.com>
* libc/stdio/wsetup.c (__swsetup): Don't make a buffer
for a string I/O file that isn't using the asprintf family.
Diffstat (limited to 'newlib/libc/stdio/wsetup.c')
-rw-r--r-- | newlib/libc/stdio/wsetup.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/newlib/libc/stdio/wsetup.c b/newlib/libc/stdio/wsetup.c index bc72996..cf56c2a 100644 --- a/newlib/libc/stdio/wsetup.c +++ b/newlib/libc/stdio/wsetup.c @@ -58,9 +58,11 @@ _DEFUN(__swsetup, (fp), /* * Make a buffer if necessary, then set _w. + * A string I/O file should not explicitly allocate a buffer + * unless asprintf is being used. */ - /* NOT NEEDED FOR CYGNUS SPRINTF ONLY jpg */ - if (fp->_bf._base == NULL) + if (fp->_bf._base == NULL + && (!(fp->_flags & __SSTR) || (fp->_flags & __SMBF))) __smakebuf (fp); if (fp->_flags & __SLBF) |