1 /*
2 * Copyright (c) 2020 Intel Corporation.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7 #undef _POSIX_C_SOURCE
8 #define _POSIX_C_SOURCE 200809L
9
10 #include <zephyr/kernel.h>
11 #include <ksched.h>
12
13 #include "footprint.h"
14
15 static const char const_string[] = "String!\n";
16 static char new_string[32];
17
run_libc(void)18 void run_libc(void)
19 {
20 int len;
21
22 len = strlen(const_string);
23 len = strnlen(const_string, len);
24
25 memset(new_string, 0, sizeof(new_string));
26 if (memcmp(const_string, new_string, 0) != 0) {
27 /* avoid unused return error */
28 }
29 if (memcmp(const_string, new_string, len) != 0) {
30 /* avoid unused return error */
31 }
32
33 strcpy(new_string, const_string);
34 strncpy(new_string, const_string, len);
35 }
36