From 178d2e4cb93d0a0b7a10b6a15de298fc0d8c766e Mon Sep 17 00:00:00 2001 From: fangting Date: Fri, 28 Jul 2023 10:11:06 +0800 Subject: [PATCH] =?UTF-8?q?codecheck=E9=97=AE=E9=A2=98=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fangting --- libc-test/src/functional/exit_constructor.c | 13 ++++++----- porting/linux/user/src/string/strcspn.c | 25 +++++++++++---------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/libc-test/src/functional/exit_constructor.c b/libc-test/src/functional/exit_constructor.c index 5fedfa32..0f96a4ee 100644 --- a/libc-test/src/functional/exit_constructor.c +++ b/libc-test/src/functional/exit_constructor.c @@ -1,11 +1,12 @@ #include #include "test.h" -__attribute__((constructor)) -void B_ctor() { - exit(t_status); -} +__attribute__((constructor)) +void Ctor() +{ + exit(t_status); -int main() { - return t_status; +int main() +{ + return t_status; } \ No newline at end of file diff --git a/porting/linux/user/src/string/strcspn.c b/porting/linux/user/src/string/strcspn.c index 30d23299..403b0f38 100644 --- a/porting/linux/user/src/string/strcspn.c +++ b/porting/linux/user/src/string/strcspn.c @@ -1,19 +1,20 @@ -// from openbsd, will be rectified later +// from openbsd, will be rectified later #include size_t strcspn(const char *string1, const char *string2) { - const char *a, *p; - char sc, c; - - for (a = string1;;) { - sc = *a++; - p = string2; - do { - if ((c = *p++) == sc) - return (a - 1 - string1); - } while (c != 0); - } + const char *a, *p; + char sc, c; + + for (a = string1;;) { + sc = *a++; + p = string2; + do { + if ((c = *p++) == sc) { + return (a - 1 - string1); +} + } while (c != 0); + } /* NOTREACHED */ } \ No newline at end of file -- GitLab