If an empty buffer is passed to rawRead, it throws. This is a somewhat arbitrary limitation, and, in the generic case that the buffer a program may want to read would happen to have a length of 0, a needless corner case the programmer must be aware of. (I've had a long-running program crash half-way through because of this.) Empty buffers are OK with the following: - File.rawWrite - fread - Socket.send - Socket.receive (although maybe this one shouldn't be, as its return value is then ambiguous).
@vali0901 created dlang/phobos pull request #8517 "Fix Issue 13893 - rawRead must take a non-empty buffer" fixing this issue: - Fix Issue 13893 - rawRead must take a non-empty buffer https://github.com/dlang/phobos/pull/8517
dlang/phobos pull request #8517 "Fix Issue 13893 - rawRead must take a non-empty buffer" was merged into master: - 85b47bc401ce227db53922c9123cb5f3671524fa by vali0901: Fix Issue 13893 - rawRead must take a non-empty buffer - 1d1621398014390734186d30be08bd1e63f3de51 by vali0901: Fix Issue 13893 - rawRead must take a non-empty buffer https://github.com/dlang/phobos/pull/8517