mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 10:01:13 +09:00
Kernel: Make KBufferBuilder::append() & friends return KResult
This allows callers to react to a failed append (due to OOM.)
This commit is contained in:
parent
b096e85777
commit
2065ced8f6
Notes:
sideshowbarker
2024-07-18 04:35:08 +09:00
Author: https://github.com/awesomekling
Commit: 2065ced8f6
7 changed files with 63 additions and 42 deletions
|
@ -57,7 +57,7 @@ KResultOr<NonnullOwnPtr<KBuffer>> Inode::read_entire(FileDescription* descriptio
|
|||
VERIFY(nread <= sizeof(buffer));
|
||||
if (nread == 0)
|
||||
break;
|
||||
builder.append((const char*)buffer, nread);
|
||||
TRY(builder.append((const char*)buffer, nread));
|
||||
offset += nread;
|
||||
if (nread < sizeof(buffer))
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue