Skip to content

Commit 6ce5619

Browse files
CopilotRbb666
andcommitted
Remove object name length assertions, keep error messages
- Remove RT_ASSERT from rt_object_init() (line 402) - Remove RT_ASSERT from rt_object_allocate() (line 518) - Keep LOG_E error messages to warn about name length issues - This allows objects with long names to be created with truncation warning Co-authored-by: Rbb666 <[email protected]>
1 parent e5d46f5 commit 6ce5619

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

src/object.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,6 @@ void rt_object_init(struct rt_object *object,
399399
if(obj_name_len > RT_NAME_MAX - 1)
400400
{
401401
LOG_E("Object name %s exceeds RT_NAME_MAX=%d, consider increasing RT_NAME_MAX.", name, RT_NAME_MAX);
402-
RT_ASSERT(obj_name_len <= RT_NAME_MAX - 1);
403402
}
404403
rt_memcpy(object->name, name, obj_name_len);
405404
object->name[obj_name_len] = '\0';
@@ -515,7 +514,6 @@ rt_object_t rt_object_allocate(enum rt_object_class_type type, const char *name)
515514
if(obj_name_len > RT_NAME_MAX - 1)
516515
{
517516
LOG_E("Object name %s exceeds RT_NAME_MAX=%d, consider increasing RT_NAME_MAX.", name, RT_NAME_MAX);
518-
RT_ASSERT(obj_name_len <= RT_NAME_MAX - 1);
519517
}
520518
rt_memcpy(object->name, name, obj_name_len);
521519
object->name[obj_name_len] = '\0';

0 commit comments

Comments
 (0)