Bug 13893 – "rawRead must take a non-empty buffer"

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-12-25T15:31:38Z
Last change time
2022-07-24T10:42:40Z
Keywords
bootcamp, pull
Assigned to
No Owner
Creator
Vladimir Panteleev

Comments

Comment #0 by dlang-bugzilla — 2014-12-25T15:31:38Z
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).
Comment #1 by dlang-bot — 2022-07-23T13:54:24Z
@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
Comment #2 by dlang-bot — 2022-07-24T10:42:40Z
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