Zero buffer for test before buffer read.

This commit is contained in:
Brad Arant 2021-09-22 18:08:56 -07:00
parent ec39c1df1a
commit 7e43656c5c

View File

@ -110,6 +110,9 @@ namespace core {
int len;
int error = -1;
for(int ix = 0; ix < buffer.getLength(); ++ix)
buffer[ix] = 0;
if((len = ::read(getDescriptor(), buffer.getData(), buffer.getLength())) >= 0) {
coreutils::ZString zbuffer(buffer.getData(), len);
onDataReceived(zbuffer);