diff options
author | Gunnar Beutner <gbeutner@serenityos.org> | 2021-06-17 11:16:11 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-17 19:52:54 +0200 |
commit | 58c182b19e897ce2317193fee0cef22d31f2b3e1 (patch) | |
tree | f80c454c6d496a1245bc717330316de2cba81f97 /Kernel/FileSystem | |
parent | bf779e182ec4f38b6d4abf470e21fcba0184c8d4 (diff) | |
download | serenity-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.cpp | 2 |
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; |