From b033314bf1901d436dc71d41d5e1f37dda47e511 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Thu, 12 Dec 2024 16:03:08 +0100 Subject: formatting: Use clang-format on all projects This commit also add braces to all `if` statements. --- userland/libc/string/sscanf.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'userland/libc/string/sscanf.c') diff --git a/userland/libc/string/sscanf.c b/userland/libc/string/sscanf.c index e1ede63..8a3ed0e 100644 --- a/userland/libc/string/sscanf.c +++ b/userland/libc/string/sscanf.c @@ -38,8 +38,9 @@ long ftnum(FILE *stream, int base, int *error) { return 0; } for (;;) { - if (EOF == (c = fgetc(stream))) + if (EOF == (c = fgetc(stream))) { break; + } if (c == '\0') { ungetc(c, stream); break; @@ -69,13 +70,15 @@ int vfscanf(FILE *stream, const char *format, va_list ap) { for (; *format; format++) { if (*format != '%' && !cont) { char c; - if (isspace(*format)) + if (isspace(*format)) { continue; + } if (EOF == (c = fgetc(stream))) { break; } - if (*format == c) // TODO: Make sure this is the correct behaviour + if (*format == c) { // TODO: Make sure this is the correct behaviour continue; + } // TODO: Make sure this is the correct behaviour errno = EINVAL; assert(0); @@ -164,8 +167,9 @@ size_t sscanf_read(FILE *f, unsigned char *s, size_t l) { s++; r++; } - if (!(*(c->s + c->offset))) + if (!(*(c->s + c->offset))) { f->is_eof = 1; + } /* memcpy(s, c->s, l); c->s += l;*/ -- cgit v1.2.3