(cantwrite): do not allocate memory for a NULL string
PR: misc/26044 MFC after: 1 week Submitted by: bde
This commit is contained in:
parent
a52532c91a
commit
1866adc54f
@ -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))
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user