提交 71cbe22b 编写于 作者: G gary.li.wenchao.4

add strlcpy

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@413 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 6c82f508
......@@ -10,6 +10,7 @@
* Change Logs:
* Date Author Notes
* 2008-08-14 Bernard the first version
* 2010-02-15 Gary Lee add strlcpy
*/
#include <rtthread.h>
......@@ -23,6 +24,23 @@ char *strcpy(char *dest, const char *src)
return rt_strncpy(dest, src, rt_strlen(src) + 1);
}
char *strncpy(char *dest, const char *src, rt_ubase_t n)
{
return rt_strncpy(dest, src, n);
}
char *strlcpy(char *dest, const char *src, rt_ubase_t n)
{
return rt_strlcpy(dest, src, n);
}
int strcmp (const char *s1, const char *s2)
{
while (*s1 && *s1 == *s2)
s1++, s2++;
return (*s1 - *s2);
}
int strcmp (const char *s1, const char *s2)
{
while (*s1 && *s1 == *s2)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册