Per POSIX, now returns B_BAD_VALUE if read position is negative (thanks Axel :-).

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4660 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Tyler Dauwalder 2003-09-12 08:49:12 +00:00
parent c6c1620a32
commit 90685fb799

View File

@ -57,9 +57,9 @@ Icb::Read(off_t pos, void *buffer, size_t *length, uint32 *block)
DEBUG_INIT_ETC(CF_PUBLIC | CF_HIGH_VOLUME, "Icb",
("pos: %lld, buffer: %p, length: (%p)->%ld", pos, buffer, length, (length ? *length : 0)));
if (!buffer || !length)
RETURN(B_BAD_VALUE);
if (!buffer || !length || pos < 0)
RETURN(B_BAD_VALUE);
if (uint64(pos) >= Length()) {
*length = 0;
return B_OK;