diff options
author | Brett Weiland <brett_weiland@bpcspace.com> | 2021-09-21 10:50:33 -0500 |
---|---|---|
committer | Brett Weiland <brett_weiland@bpcspace.com> | 2021-09-21 10:50:33 -0500 |
commit | cf7cd8be60c254b44b444c97dcb238d7cf3afd4c (patch) | |
tree | e86fe62827f4dbc5f1b6b74cf7bd89c78e797711 /src/kernel/libc.c | |
parent | 907fb823bf8329066b1bcff60ea6c4faa54a3642 (diff) |
palloc smp safe (testing required, NOT pfree)
Diffstat (limited to 'src/kernel/libc.c')
-rw-r--r-- | src/kernel/libc.c | 8 |
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++) { |