AutoDeleteArray -> std::unique_ptr
Also, switch to C++14 for std::make_unique.
This commit is contained in:
parent
40dfac968a
commit
2b9d0a99cb
5 changed files with 10 additions and 24 deletions
|
|
@ -599,9 +599,8 @@ void RemoteStore::Connection::processStderr(Sink * sink, Source * source)
|
|||
else if (msg == STDERR_READ) {
|
||||
if (!source) throw Error("no source");
|
||||
size_t len = readInt(from);
|
||||
unsigned char * buf = new unsigned char[len];
|
||||
AutoDeleteArray<unsigned char> d(buf);
|
||||
writeString(buf, source->read(buf, len), to);
|
||||
auto buf = std::make_unique<unsigned char[]>(len);
|
||||
writeString(buf.get(), source->read(buf.get(), len), to);
|
||||
to.flush();
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue