mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-20 17:44:20 +08:00
fixed object name copy bug; update AT91SAM7S64 branch.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1787 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
+2
-8
@@ -204,10 +204,7 @@ void rt_object_init(struct rt_object *object, enum rt_object_class_type type, co
|
||||
object->type = type | RT_Object_Class_Static;
|
||||
|
||||
/* copy name */
|
||||
for (temp = 0; temp < RT_NAME_MAX; temp ++)
|
||||
{
|
||||
object->name[temp] = name[temp];
|
||||
}
|
||||
rt_strncpy(object->name, name, RT_NAME_MAX);
|
||||
|
||||
RT_OBJECT_HOOK_CALL(rt_object_attach_hook, (object));
|
||||
|
||||
@@ -296,10 +293,7 @@ rt_object_t rt_object_allocate(enum rt_object_class_type type, const char *name)
|
||||
#endif
|
||||
|
||||
/* copy name */
|
||||
for (temp = 0; temp < RT_NAME_MAX; temp ++)
|
||||
{
|
||||
object->name[temp] = name[temp];
|
||||
}
|
||||
rt_strncpy(object->name, name, RT_NAME_MAX);
|
||||
|
||||
RT_OBJECT_HOOK_CALL(rt_object_attach_hook, (object));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user