hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/user/chat.c
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-10-10 10:31:01 +0200
committerhachem <im@hachem.wtf>2026-10-10 10:31:01 +0200
commitcc8768d33a6ff6cc64306d01679a10c3a1847736 (patch)
tree144b2f68c6e6ed482b99e45e981854bfd5db59e6 /user/chat.c
parent89abe49aad1ac7416844f3c5e95655ad2614392b (diff)
chore: small refactor
Diffstat (limited to 'user/chat.c')
-rw-r--r--user/chat.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/user/chat.c b/user/chat.c
index 67bc727..1657c73 100644
--- a/user/chat.c
+++ b/user/chat.c
@@ -24,10 +24,9 @@ void _start(const char* arg, unsigned long arglen)
}
char buffer[256];
- long n;
- while ((n = sys_read(fd, buffer, sizeof(buffer))) > 0)
- sys_write(1, buffer, (unsigned long)n);
-
- sys_close(fd);
+ long bytes_read;
+ while ((bytes_read = sys_read(fd, buffer, sizeof(buffer))) > 0)
+ (void)sys_write(1, buffer, (unsigned long)bytes_read);
+ (void)sys_close(fd);
sys_exit(0);
}