1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-25 22:15:06 +00:00

Kernel: Update check in Inode::read_entire

The nread variable can't be less than zero anymore.
This commit is contained in:
Gunnar Beutner 2021-06-17 11:16:11 +02:00 committed by Andreas Kling
parent bf779e182e
commit 58c182b19e

View file

@ -61,7 +61,7 @@ KResultOr<NonnullOwnPtr<KBuffer>> Inode::read_entire(FileDescription* descriptio
return result.error();
nread = result.value();
VERIFY(nread <= sizeof(buffer));
if (nread <= 0)
if (nread == 0)
break;
builder.append((const char*)buffer, nread);
offset += nread;