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:
13
src/helper.c
13
src/helper.c
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user