diff --git a/src/kernel/boot/loader/file_systems/bfs/File.cpp b/src/kernel/boot/loader/file_systems/bfs/File.cpp index 122d0d9fee..b4cea6b7d4 100644 --- a/src/kernel/boot/loader/file_systems/bfs/File.cpp +++ b/src/kernel/boot/loader/file_systems/bfs/File.cpp @@ -47,7 +47,11 @@ File::InitCheck() ssize_t File::ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize) { - return fStream.ReadAt(pos, (uint8 *)buffer, &bufferSize); + status_t status = fStream.ReadAt(pos, (uint8 *)buffer, &bufferSize); + if (status < B_OK) + return status; + + return bufferSize; } diff --git a/src/kernel/boot/loader/file_systems/bfs/Volume.h b/src/kernel/boot/loader/file_systems/bfs/Volume.h index 68e6a9e4d1..af019b9e23 100644 --- a/src/kernel/boot/loader/file_systems/bfs/Volume.h +++ b/src/kernel/boot/loader/file_systems/bfs/Volume.h @@ -47,7 +47,7 @@ class Volume { off_t ToOffset(block_run run) const { return ToBlock(run) << BlockShift(); } off_t ToOffset(off_t block) const { return block << BlockShift(); } - off_t ToBlock(block_run run) const { return ((((off_t)run.AllocationGroup()) << AllocationGroupShift()) | (off_t)run.Start()); } + off_t ToBlock(block_run run) const { return ((off_t)run.AllocationGroup() << AllocationGroupShift()) | (uint32)run.Start(); } block_run ToBlockRun(off_t block) const; status_t ValidateBlockRun(block_run run);