summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-06-17 11:16:11 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-17 19:52:54 +0200
commit58c182b19e897ce2317193fee0cef22d31f2b3e1 (patch)
treef80c454c6d496a1245bc717330316de2cba81f97 /Kernel/FileSystem
parentbf779e182ec4f38b6d4abf470e21fcba0184c8d4 (diff)
downloadserenity-58c182b19e897ce2317193fee0cef22d31f2b3e1.zip
Kernel: Update check in Inode::read_entire
The nread variable can't be less than zero anymore.
Diffstat (limited to 'Kernel/FileSystem')
-rw-r--r--Kernel/FileSystem/Inode.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/FileSystem/Inode.cpp b/Kernel/FileSystem/Inode.cpp
index f7283fa5b8..afcbadedec 100644
--- a/Kernel/FileSystem/Inode.cpp
+++ b/Kernel/FileSystem/Inode.cpp
@@ -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;