iotivity-constrained
iotivity-constrained copied to clipboard
Bug in oc_core_res.c
Hi,
I think that I found a bug in the function oc_core_get_resource_by_uri() in api/oc_core_res.c on master branch.
oc_resource_t *
oc_core_get_resource_by_uri(const char *uri, int device)
{
int skip = 0, type = 0;
if (uri[0] != '/')
skip = 1;
...
}
In the code above the variable skip would means a number of leading slash of the uri. So the code would be fixed like this.
oc_resource_t *
oc_core_get_resource_by_uri(const char *uri, int device)
{
int skip = 0, type = 0;
if (uri[0] == '/')
skip = 1;
...
}
Thanks