summaryrefslogtreecommitdiff
path: root/src/kernel/vfs/request.c
diff options
context:
space:
mode:
authordzwdz2021-09-21 18:11:10 +0200
committerdzwdz2021-09-21 18:11:10 +0200
commit262311a02c4bcf001d1b2a4ce496a5a83ec4f9e1 (patch)
treee2aee71abbe5aac7b51d8e902a3d154376fae5fd /src/kernel/vfs/request.c
parent2373680d99372b9e7cdecf1c8d4b0a7366eb3cfb (diff)
implement (safe) min/max macros
Diffstat (limited to 'src/kernel/vfs/request.c')
-rw-r--r--src/kernel/vfs/request.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/kernel/vfs/request.c b/src/kernel/vfs/request.c
index fcd6c47..9826982 100644
--- a/src/kernel/vfs/request.c
+++ b/src/kernel/vfs/request.c
@@ -47,12 +47,7 @@ _Noreturn void vfs_request_pass2handler(struct vfs_request *req) {
handler->state = PS_RUNNING;
handler->handled_req = req;
- len = handler->awaited_req.max_len;
- if (len > req->input.len) {
- // input bigger than buffer
- // TODO what should be done during e.g. open() calls? truncating doesn't seem right
- len = req->input.len;
- }
+ len = min(req->input.len, handler->awaited_req.max_len);
if (req->input.kern) {
if (!virt_cpy_to(handler->pages,