use strlcpy instead of rt_strlcpy.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@498 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
parent
c9ee5a0635
commit
ce36652552
|
@ -14,6 +14,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "rtc_calendar.h"
|
#include "rtc_calendar.h"
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
extern void rt_hw_console_putc(char c);
|
extern void rt_hw_console_putc(char c);
|
||||||
extern rt_uint8_t rt_hw_serial_getc(void);
|
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"};
|
rt_uint8_t *list_month[12]={"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
|
||||||
void rt_calendar(void)
|
void rt_calendar(void)
|
||||||
{
|
{
|
||||||
|
@ -220,9 +221,9 @@ void rt_calendar(void)
|
||||||
rt_int32_t result, num_month, num_year;
|
rt_int32_t result, num_month, num_year;
|
||||||
rt_uint8_t date_year[7], date_month[3], *date = __DATE__;
|
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;
|
date += 7;
|
||||||
rt_strlcpy((char *)date_year, (const char *)date, 4);
|
strlcpy((char *)date_year, (const char *)date, 4);
|
||||||
date = RT_NULL;
|
date = RT_NULL;
|
||||||
num_year = atoi(date_year);
|
num_year = atoi(date_year);
|
||||||
do{
|
do{
|
||||||
|
|
Loading…
Reference in New Issue