summaryrefslogtreecommitdiff
path: root/userland/libc/stdio/stdin.c
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-12-12 16:03:08 +0100
committerAnton Kling <anton@kling.gg>2024-12-12 16:03:08 +0100
commitb033314bf1901d436dc71d41d5e1f37dda47e511 (patch)
tree120bd137888a7f96904a47af7d20422608ffe225 /userland/libc/stdio/stdin.c
parentdcbcdbdc5bcfb86eca05fb655e3bf009d89e39e0 (diff)
formatting: Use clang-format on all projects
This commit also add braces to all `if` statements.
Diffstat (limited to 'userland/libc/stdio/stdin.c')
-rw-r--r--userland/libc/stdio/stdin.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/userland/libc/stdio/stdin.c b/userland/libc/stdio/stdin.c
index e497167..4620df3 100644
--- a/userland/libc/stdio/stdin.c
+++ b/userland/libc/stdio/stdin.c
@@ -36,8 +36,9 @@ size_t write_fd(FILE *f, const unsigned char *s, size_t l) {
size_t non_cache_read_fd(FILE *f, unsigned char *s, size_t l) {
int rc = read(f->fd, s, l);
- if (rc == 0)
+ if (rc == 0) {
f->is_eof = 1;
+ }
if (rc == -1) {
f->has_error = 1;
return 0;
@@ -46,8 +47,9 @@ size_t non_cache_read_fd(FILE *f, unsigned char *s, size_t l) {
}
size_t read_fd(FILE *f, unsigned char *s, size_t l) {
- if (0 == l)
+ if (0 == l) {
return 0;
+ }
// Skip using cache if the length being requested if longer than or
// equal to the cache block size. This avoids doing a bunch of extra