(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 Westerlund 2001-06-18 04:44:23 +00:00
parent a52532c91a
commit 1866adc54f

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))
/*