File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
components/libc/compilers/common Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 1616 * 2012-12-08 Bernard <clock_time.c> fix the issue of _timevalue.tv_usec initialization,
1717 * which found by Rob <rdent@iinet.net.au>
1818 * 2021-02-12 Meco Man move all of the functions located in <clock_time.c> to this file
19+ * 2021-03-15 Meco Man fixed bug: https://club.rt-thread.org/ask/question/423650.html
1920 */
2021
2122#include <sys/time.h>
@@ -152,13 +153,14 @@ char* asctime_r(const struct tm *t, char *buf)
152153 num2str (buf + 20 , (t -> tm_year + 1900 ) / 100 );
153154 num2str (buf + 22 , (t -> tm_year + 1900 ) % 100 );
154155 buf [24 ] = '\n' ;
156+ buf [25 ] = '\0' ;
155157 return buf ;
156158}
157159RTM_EXPORT (asctime_r );
158160
159161char * asctime (const struct tm * timeptr )
160162{
161- static char buf [25 ];
163+ static char buf [26 ];
162164 return asctime_r (timeptr , buf );
163165}
164166RTM_EXPORT (asctime );
You can’t perform that action at this time.
0 commit comments