axl_strncpy

This commit is contained in:
NukeBird 2025-11-27 21:10:44 +03:00
parent e7e337c873
commit 6942e962e2
2 changed files with 18 additions and 0 deletions

View file

@ -20,3 +20,20 @@ i8* axl_strcpy(i8* dst, const i8* src)
return start;
}
i8* axl_strncpy(i8* dst, const i8* src, u32 n)
{
u32 i = 0;
for(; i < n && src[i] != '\0'; i++)
{
dst[i] = src[i];
}
for(; i < n; i++)
{
dst[i] = '\0';
}
return dst;
}

View file

@ -5,5 +5,6 @@
u32 axl_strlen(const i8* s);
i8* axl_strcpy(i8* dst, const i8* src);
i8* axl_strncpy(i8* dst, const i8* src, u32 n);
#endif // AXL_STRING