diff options
| author | 陈豪 | Jacob Chen <[email protected]> | 2015-03-29 18:35:44 +0800 |
|---|---|---|
| committer | 陈豪 | Jacob Chen <[email protected]> | 2015-03-29 18:35:44 +0800 |
| commit | 9a4dacaad743801c9be2dbae49251c4e1b8f99a9 (patch) | |
| tree | 34def3bef5c5fc4a9b7594eba5a2729f8c86aab0 /src/object.c | |
| parent | daac5388afe5a18d51e9839719de8423b62b00c1 (diff) | |
| parent | 5af7abd8c2e8b8a39c0bf096bdf9b5cb08f266fa (diff) | |
Merge pull request #3 from RT-Thread/master
111
Diffstat (limited to 'src/object.c')
| -rw-r--r-- | src/object.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/object.c b/src/object.c index 32dc0f2384..6c5a1a026f 100644 --- a/src/object.c +++ b/src/object.c @@ -417,7 +417,7 @@ rt_object_t rt_object_find(const char *name, rt_uint8_t type) { const char *name_ptr; int module_name_length; - + name_ptr = name; while ((*name_ptr != '\0') && (*name_ptr != '/')) name_ptr ++; @@ -434,13 +434,13 @@ rt_object_t rt_object_find(const char *name, rt_uint8_t type) /* find module */ information = &rt_object_container[RT_Object_Class_Module]; - for (node = information->object_list.next; + for (node = information->object_list.next; node != &(information->object_list); node = node->next) { object = rt_list_entry(node, struct rt_object, list); if ((rt_strncmp(object->name, name, module_name_length) == 0) && - module_name_length == RT_NAME_MAX || object->name[module_name_length] == '\0') + (module_name_length == RT_NAME_MAX || object->name[module_name_length] == '\0')) { /* get module */ module = (struct rt_module*)object; @@ -450,7 +450,7 @@ rt_object_t rt_object_find(const char *name, rt_uint8_t type) rt_exit_critical(); /* there is no this module inside the system */ - if (module == RT_NULL) return RT_NULL; + if (module == RT_NULL) return RT_NULL; /* get the object pool of module */ information = &(module->module_object[type]); |
