[Issue 13893] New: "rawRead must take a non-empty buffer"
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Thu Dec 25 07:31:38 PST 2014
https://issues.dlang.org/show_bug.cgi?id=13893
Issue ID: 13893
Summary: "rawRead must take a non-empty buffer"
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: Phobos
Assignee: nobody at puremagic.com
Reporter: thecybershadow at gmail.com
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).
--
More information about the Digitalmars-d-bugs
mailing list