hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/user/chat.c
diff options
context:
space:
mode:
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);
}