Implement VFS syscalls
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m29s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m29s
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include <fs/path.h>
|
||||
#include <fs/ramdiskfs.h>
|
||||
#include <fs/vfs.h>
|
||||
#include <libk/minmax.h>
|
||||
#include <libk/std.h>
|
||||
#include <libk/string.h>
|
||||
#include <limine/requests.h>
|
||||
@@ -129,10 +130,7 @@ int ramdiskfs_read (struct vfs_mountpoint* mountpoint, const char* path, uint8_t
|
||||
if (file == NULL)
|
||||
return -ST_NOT_FOUND;
|
||||
|
||||
if (off + size > file->size)
|
||||
return -ST_OOB_ERROR;
|
||||
|
||||
memcpy (buffer, (void*)((uintptr_t)file->content + off), size);
|
||||
memcpy (buffer, (void*)((uintptr_t)file->content + off), min (size, file->size));
|
||||
|
||||
return ST_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user