cwFile.cpp : Added guard to not write if bufByteCnt is 0.
This commit is contained in:
parent
ce55c64a3b
commit
d499dfac1c
@ -252,9 +252,12 @@ cw::rc_t cw::file::write( handle_t h, const void* buf, unsigned bufByteCnt )
|
||||
if( p->lastRC != kOkRC )
|
||||
return p->lastRC;
|
||||
|
||||
if( bufByteCnt )
|
||||
{
|
||||
errno = 0;
|
||||
if( fwrite(buf,bufByteCnt,1,p->fp) != 1 )
|
||||
return p->lastRC = cwLogSysError(kWriteFailRC,errno,"File write failed on '%s'.", cwStringNullGuard(p->fnStr));
|
||||
}
|
||||
|
||||
return kOkRC;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user