summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/object.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/object.c b/src/object.c
index fa14bcb7a2..cb177edbe6 100644
--- a/src/object.c
+++ b/src/object.c
@@ -366,8 +366,7 @@ void rt_object_init(struct rt_object *object,
/* set object type to static */
object->type = type | RT_Object_Class_Static;
/* copy name */
- rt_strncpy(object->name, name, RT_NAME_MAX - 1);
- object->name[RT_NAME_MAX - 1] = '\0';
+ rt_strncpy(object->name, name, RT_NAME_MAX);
RT_OBJECT_HOOK_CALL(rt_object_attach_hook, (object));