(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
d9a93f32bc
commit
4c51e07cb5
@ -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