fat_io_lib port WIP
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m12s

This commit is contained in:
2026-02-26 23:33:03 +01:00
parent 9758d79303
commit baa13fb695
15 changed files with 3607 additions and 18 deletions

View File

@@ -65,3 +65,30 @@ int strcmp (const char* s1, const char* s2) {
}
return *(const unsigned char*)s1 - *(const unsigned char*)s2;
}
/* https://stackoverflow.com/a/2490637 */
char* strcat (char* dest, const char* src) {
char* rdest = dest;
while (*dest)
dest++;
while ((*dest++ = *src++))
;
return rdest;
}
char* strncat (char* dest, const char* src, size_t n) {
char* ptr = dest;
while (*ptr != '\0')
ptr++;
while (n > 0 && *src != '\0') {
*ptr++ = *src++;
n--;
}
*ptr = '\0';
return dest;
}

View File

@@ -10,6 +10,7 @@ size_t strlen (const char* str);
int memcmp (const void* s1, const void* s2, size_t n);
int strncmp (const char* s1, const char* s2, size_t n);
int strcmp (const char* s1, const char* s2);
char* strncat (char* dest, const char* src, size_t n);
#define strlen_null(x) (strlen ((x)) + 1)