summaryrefslogtreecommitdiff
path: root/libio
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2009-11-24 16:24:59 +0100
committerAndreas Schwab <schwab@redhat.com>2009-11-24 16:24:59 +0100
commit13cada74709e88387c4f086d4042683f86e2e10f (patch)
tree2f264830ff2eab5de6216b6eab2a9206c65dd8d1 /libio
parent4909e83159d429b1fd9a679c78cba24e610fd5a6 (diff)
parent49c7f27194d16976a6bb9c5b7be186662ec7a6e6 (diff)
Merge remote branch 'origin/master' into fedora/master
Diffstat (limited to 'libio')
-rw-r--r--libio/libio.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/libio/libio.h b/libio/libio.h
index 643812f72b..3c9f2bd3e8 100644
--- a/libio/libio.h
+++ b/libio/libio.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1995,1997-2006,2007 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1995,1997-2006,2007,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Per Bothner <bothner@cygnus.com>.
@@ -442,13 +442,15 @@ extern _IO_wint_t __woverflow (_IO_FILE *, _IO_wint_t);
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
# define _IO_getwc_unlocked(_fp) \
- (_IO_BE ((_fp)->_wide_data->_IO_read_ptr >= (_fp)->_wide_data->_IO_read_end,\
- 0) \
+ (_IO_BE ((_fp)->_wide_data == NULL \
+ || ((_fp)->_wide_data->_IO_read_ptr \
+ >= (_fp)->_wide_data->_IO_read_end), 0) \
? __wuflow (_fp) : (_IO_wint_t) *(_fp)->_wide_data->_IO_read_ptr++)
# define _IO_putwc_unlocked(_wch, _fp) \
- (_IO_BE ((_fp)->_wide_data->_IO_write_ptr \
- >= (_fp)->_wide_data->_IO_write_end, 0) \
- ? __woverflow (_fp, _wch) \
+ (_IO_BE ((_fp)->_wide_data == NULL \
+ || ((_fp)->_wide_data->_IO_write_ptr \
+ >= (_fp)->_wide_data->_IO_write_end), 0) \
+ ? __woverflow (_fp, _wch) \
: (_IO_wint_t) (*(_fp)->_wide_data->_IO_write_ptr++ = (_wch)))
#endif