axl_strncpy
This commit is contained in:
parent
e7e337c873
commit
6942e962e2
2 changed files with 18 additions and 0 deletions
|
|
@ -20,3 +20,20 @@ i8* axl_strcpy(i8* dst, const i8* src)
|
||||||
|
|
||||||
return start;
|
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;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,5 +5,6 @@
|
||||||
|
|
||||||
u32 axl_strlen(const i8* s);
|
u32 axl_strlen(const i8* s);
|
||||||
i8* axl_strcpy(i8* dst, const i8* src);
|
i8* axl_strcpy(i8* dst, const i8* src);
|
||||||
|
i8* axl_strncpy(i8* dst, const i8* src, u32 n);
|
||||||
|
|
||||||
#endif // AXL_STRING
|
#endif // AXL_STRING
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue