kernel - whatever

This commit is contained in:
RaphProductions 2025-05-14 18:15:15 +02:00
parent 0772a48c29
commit 31e53e88b9
10 changed files with 112 additions and 32 deletions

View file

@ -68,4 +68,14 @@ char *strdup(const char *str) {
strcpy(dup, str);
return dup;
}
}
char *strncpy(char *dest, const char *src, size_t n) {
size_t i;
for (i = 0; i < n && src[i] != '\0'; i++)
dest[i] = src[i];
for (; i < n; i++)
dest[i] = '\0';
return dest;
}

View file

@ -1,4 +1,5 @@
#pragma once
#include <stddef.h>
int strlen(const char *str);
int strcmp(const char *s1, const char *s2);
@ -6,4 +7,5 @@ char *strchr(const char *s, int c);
char *strcpy(char *dest, const char *src);
char *strrchr(const char *s, int c);
int oct2bin(unsigned char *str, int size);
char *strdup(const char *str);
char *strdup(const char *str);
char *strncpy(char *dest, const char *src, size_t n);