diff --git a/docs/reference/device.md b/docs/reference/device.md index 189bfbe2dee..3cea5594a9c 100644 --- a/docs/reference/device.md +++ b/docs/reference/device.md @@ -93,6 +93,8 @@ The `wb_device_get_model` function returns the model string of the device corres This function returns NULL if the WbDeviceTag does not match a valid device, or returns an empty string if the device is not a solid device (i.e. does not have a `model` field). +> **Note** [C, C++]: The returned string is a pointer to the internal values managed by the [Device](#device) node, therefore it is illegal to free this pointer. + --- #### `wb_device_get_name` @@ -175,6 +177,8 @@ The `wb_device_get_name` function converts the WbDeviceTag given as parameter (` This function returns NULL if the WbDeviceTag does not match a valid device. +> **Note** [C, C++]: The returned string is a pointer to the internal values managed by the [Device](#device) node, therefore it is illegal to free this pointer. + --- #### `wb_device_get_node_type` diff --git a/src/controller/c/robot.c b/src/controller/c/robot.c index 4bf3d46c732..15620eb2008 100644 --- a/src/controller/c/robot.c +++ b/src/controller/c/robot.c @@ -525,7 +525,7 @@ void robot_read_answer(WbDevice *d, WbRequest *r) { } } -// Protected funtions available from other files of the client library +// Protected functions available from other files of the client library const char *robot_get_device_name(WbDeviceTag tag) { if (tag < robot.n_device)