···4040 Note that this is dangerous because it writes memory no matter the size
4141 the 'dest' buffer is. */
4242char* strcpy(char* dest, const char* src);
4343+int strcmp(const char* a, const char* b);
43444445/* Copy 'src' into 'dest' until it finds a null byte or reaches the 'nbytes'
4546 limit provided by the user. This is the recommended way of copying strings,
+7
libs/libc/init/_lib.c
···88{
99 _malloc_init();
1010 _stdio_init();
1111+ extern void (*__init_array_start[])(int, char**, char**) __attribute__((visibility("hidden")));
1212+ extern void (*__init_array_end[])(int, char**, char**) __attribute__((visibility("hidden")));
1313+1414+ const unsigned int size = __init_array_end - __init_array_start;
1515+ for (unsigned int i = 0; i < size; i++) {
1616+ (*__init_array_start[i])(0, 0, 0);
1717+ }
1118}
12191320void _libc_deinit()
+16
libs/libc/string/string.c
···9393 return 0;
9494}
95959696+int strcmp(const char* a, const char* b)
9797+{
9898+ while (*a == *b && *a != '\0' && *b != '\0') {
9999+ a++;
100100+ b++;
101101+ }
102102+103103+ if (a < b) {
104104+ return -1;
105105+ }
106106+ if (a > b) {
107107+ return 1;
108108+ }
109109+ return 0;
110110+}
111111+96112size_t strlen(const char* str)
97113{
98114 size_t i = 0;