(cantwrite): do not allocate memory for a NULL string

PR:		misc/26044

MFC after:	1 week

Submitted by:	bde
This commit is contained in:
assar 2001-06-18 04:44:23 +00:00
parent d9a93f32bc
commit 4c51e07cb5

View File

@ -81,7 +81,8 @@ struct __sFILEX {
* Return true iff the given FILE cannot be written now.
*/
#define cantwrite(fp) \
((((fp)->_flags & __SWR) == 0 || (fp)->_bf._base == NULL) && \
((((fp)->_flags & __SWR) == 0 || \
((fp)->_bf._base == NULL && ((fp)->_flags & __SSTR) == 0)) && \
__swsetup(fp))
/*