error: add proper error strings

Co-authored-by: tema5002 <tema5002@tuta.io>
Reviewed-on: #3
Co-committed-by: tema5002 <tema5002@tuta.io>
This commit was merged in pull request #3.
This commit is contained in:
2026-05-24 12:08:07 +02:00
committed by Blendi
parent 0d6b1c6729
commit fbbe2e8285
9 changed files with 329 additions and 61 deletions

View File

@@ -21,6 +21,19 @@ int noom_streql(const char* stra, noom_uint_t lena, const char* strb, noom_uint_
return 1;
}
noom_uint_t noom_strlen(const char *s)
{
const char *a = s;
while (*s) s++;
return s - a;
}
void noom_safe_strcpy(char* buffer, noom_uint_t* pos, noom_uint_t buffer_size, const char* src) {
while (*src && *pos < buffer_size - 1) {
buffer[(*pos)++] = *src++;
}
}
#include <stdlib.h> // TODO: remove
void* noom_alloc(noom_uint_t size) {