summaryrefslogtreecommitdiff
path: root/src/kernel/libc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/libc.c')
-rw-r--r--src/kernel/libc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/kernel/libc.c b/src/kernel/libc.c
index 4278281..f46c59f 100644
--- a/src/kernel/libc.c
+++ b/src/kernel/libc.c
@@ -1,5 +1,6 @@
#include <stddef.h>
#include <stdint.h>
+#include <stdbool.h>
// TODO clean up variable names
int strncmp(const char *s1, const char *s2, unsigned int n) {
int i;
@@ -18,6 +19,13 @@ size_t strlen(const char *s) {
return(len);
}
+bool is_empty(const char *s, size_t size) {
+ for(size_t i = 0; i < size; i++) {
+ if(s[i]) return false;
+ }
+ return true;
+}
+
int strcmp(const char *s1, const char *s2) {
int i;
for(i = 0; ((s1[i] != '\0') && (s2[i] != '\0')); i++) {