Port fat_io_lib, mount atasd0mp1 as sys:

This commit is contained in:
2025-11-19 15:50:00 +01:00
parent 5d77974586
commit 0cc78a7247
35 changed files with 7071 additions and 7 deletions

View File

@ -14,7 +14,7 @@ void *memcpy(void *dst, const void *src, size_t n) {
return dst;
}
size_t strlen(char *s) {
size_t strlen(const char *s) {
char *s2;
for (s2 = s; *s2; ++s2);
return (s2 - s);
@ -149,3 +149,27 @@ char *strcat(char *dest, const char *src) {
dest[i+j] = '\0';
return dest;
}
int strncmp( const char * s1, const char * s2, size_t n )
{
while ( n && *s1 && ( *s1 == *s2 ) )
{
++s1;
++s2;
--n;
}
if ( n == 0 )
{
return 0;
}
else
{
return ( *(unsigned char *)s1 - *(unsigned char *)s2 );
}
}
void strncpy( char* _dst, const char* _src, size_t _n )
{
size_t i = 0;
while(i++ != _n && (*_dst++ = *_src++));
}