提交 ce366525 编写于 作者: B bernard.xiong

use strlcpy instead of rt_strlcpy.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@498 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 c9ee5a06
......@@ -14,6 +14,7 @@
*/
#include "rtc_calendar.h"
#include <string.h>
extern void rt_hw_console_putc(char c);
extern rt_uint8_t rt_hw_serial_getc(void);
......@@ -210,7 +211,7 @@ void rt_rtc_weekdate_calculate(void)
}
extern char *rt_strlcpy(char *dest, const char *src, rt_ubase_t n);
extern size_t strlcpy(char *dest, const char *src, size_t siz);
rt_uint8_t *list_month[12]={"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
void rt_calendar(void)
{
......@@ -220,9 +221,9 @@ void rt_calendar(void)
rt_int32_t result, num_month, num_year;
rt_uint8_t date_year[7], date_month[3], *date = __DATE__;
rt_strlcpy((char *)date_month, (const char *)date, 3);
strlcpy((char *)date_month, (const char *)date, 3);
date += 7;
rt_strlcpy((char *)date_year, (const char *)date, 4);
strlcpy((char *)date_year, (const char *)date, 4);
date = RT_NULL;
num_year = atoi(date_year);
do{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册