aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/libio/genops.c
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@gcc.gnu.org>2000-08-15 07:33:00 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>2000-08-15 07:33:00 +0000
commitd04703d6d701b2a22b11d94c6fbfa2c44a522092 (patch)
tree89ac49e996bad10bbe476c96c7b956f2cc858d99 /libstdc++-v3/libio/genops.c
parent9f34e6e805cd37bb4c095889eafa0949d1274cfa (diff)
downloadgcc-d04703d6d701b2a22b11d94c6fbfa2c44a522092.zip
gcc-d04703d6d701b2a22b11d94c6fbfa2c44a522092.tar.gz
gcc-d04703d6d701b2a22b11d94c6fbfa2c44a522092.tar.bz2
C/C++ io merge/sync.
2000-08-14 Benjamin Kosnik <bkoz@purist.soma.redhat.com> C/C++ io merge/sync. * libio/fileops.c * libio/genops.c * libio/iofclose.c * libio/iofopen.c * libio/iofwide.c * libio/libio.h * libio/libioP.h * libio/stdio.c * libio/wfileops.c * libio/wgenops.c * config/c_io_libio.cc (__basic_file): Add hacky casts to ((struct _IO_FILE_plus *) in ctors. (__basic_file<wchar_t>): Adjust _wide_data->_codecvt to just _codecvt. * libio/Makefile.am: Fix copyright. Remove cleanup.c. * libio/cleanup.c: Remove. * libio/filedoalloc.c (_IO_file_doallocate): Don't call _IO_cleanup_registration_needed, even if not libc. * testsuite/27_io/stringstream.cc (test02): Fix. From-SVN: r35694
Diffstat (limited to 'libstdc++-v3/libio/genops.c')
-rw-r--r--libstdc++-v3/libio/genops.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libstdc++-v3/libio/genops.c b/libstdc++-v3/libio/genops.c
index 5d8f520..b1ae5af 100644
--- a/libstdc++-v3/libio/genops.c
+++ b/libstdc++-v3/libio/genops.c
@@ -758,8 +758,9 @@ _IO_flush_all ()
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
|| (fp->_vtable_offset == 0
&& fp->_mode > 0 && (fp->_wide_data->_IO_write_ptr
- > fp->_wide_data->_IO_write_base)))
+ > fp->_wide_data->_IO_write_base))
#endif
+ )
&& _IO_OVERFLOW (fp, EOF) == EOF)
result = EOF;
return result;
@@ -983,9 +984,11 @@ _IO_default_pbackfail (fp, c)
new_buf = (char *) malloc (new_size);
if (new_buf == NULL)
return EOF;
- memcpy (new_buf + old_size, fp->_IO_read_base, old_size);
+ memcpy (new_buf + (new_size - old_size), fp->_IO_read_base,
+ old_size);
free (fp->_IO_read_base);
- _IO_setg (fp, new_buf, new_buf + old_size, new_buf + new_size);
+ _IO_setg (fp, new_buf, new_buf + (new_size - old_size),
+ new_buf + new_size);
fp->_IO_backup_base = fp->_IO_read_ptr;
}