提交 6a05ddf6 编写于 作者: mysterywolf's avatar mysterywolf 提交者: guo

解决将RT_NULL当做数字0使用的问题

上级 f27110de
...@@ -608,7 +608,7 @@ MSH_CMD_EXPORT_ALIAS(cmd_echo, echo, echo string to file); ...@@ -608,7 +608,7 @@ MSH_CMD_EXPORT_ALIAS(cmd_echo, echo, echo string to file);
static int cmd_tail(int argc, char **argv) static int cmd_tail(int argc, char **argv)
{ {
int fd; int fd;
char c = RT_NULL; char c = '\0';
char *file_name = RT_NULL; char *file_name = RT_NULL;
rt_uint32_t total_lines = 0; rt_uint32_t total_lines = 0;
rt_uint32_t target_line = 0; rt_uint32_t target_line = 0;
......
...@@ -180,7 +180,7 @@ struct tm *gmtime_r(const time_t *timep, struct tm *r) ...@@ -180,7 +180,7 @@ struct tm *gmtime_r(const time_t *timep, struct tm *r)
return RT_NULL; return RT_NULL;
} }
rt_memset(r, RT_NULL, sizeof(struct tm)); rt_memset(r, 0, sizeof(struct tm));
r->tm_sec = work % 60; r->tm_sec = work % 60;
work /= 60; work /= 60;
...@@ -258,7 +258,7 @@ char* asctime_r(const struct tm *t, char *buf) ...@@ -258,7 +258,7 @@ char* asctime_r(const struct tm *t, char *buf)
return RT_NULL; return RT_NULL;
} }
rt_memset(buf, RT_NULL, 26); rt_memset(buf, 0, 26);
/* Checking input validity */ /* Checking input validity */
if ((int)rt_strlen(days) <= (t->tm_wday << 2) || (int)rt_strlen(months) <= (t->tm_mon << 2)) if ((int)rt_strlen(days) <= (t->tm_wday << 2) || (int)rt_strlen(months) <= (t->tm_mon << 2))
......
...@@ -136,7 +136,7 @@ void _pthread_data_destroy(_pthread_data_t *ptd) ...@@ -136,7 +136,7 @@ void _pthread_data_destroy(_pthread_data_t *ptd)
ptd->magic = 0x0; ptd->magic = 0x0;
/* clear the "ptd->tid->user_data" */ /* clear the "ptd->tid->user_data" */
ptd->tid->user_data = RT_NULL; ptd->tid->user_data = 0;
/* free ptd */ /* free ptd */
rt_free(ptd); rt_free(ptd);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册