Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
DIR *dir = opendir(path);
int ret;
- /* non-existent directory. */
+ /* Non-existent directory. */
if (!dir) {
ret = 0;
goto end;
}
while ((d = readdir(dir)) != NULL) {
+ /* Ignore "." and ".." directories. */
if (++n > 2) {
break;
}
goto end;
}
status = bt_value_bool_get(value, &bool_val);
- switch (status) {
- case BT_VALUE_STATUS_OK:
- break;
- default:
+ if (status != BT_VALUE_STATUS_OK) {
ret = BT_COMPONENT_STATUS_ERROR;
goto end;
}
+
*option = (bool) bool_val;
if (found) {
*found = true;