/* Check if there is any duplicate of the current setting. 
This function checks if there is any duplicated data further in the buffer. */
static bool settings_fcb_check_duplicate(struct settings_fcb *cf, const struct fcb_entry_ctx *entry_ctx, const char *const name)
/* Check if there is any duplicate of the current setting. 
This function checks if there is any duplicated data further in the buffer. */
static bool settings_fcb_check_duplicate(struct settings_fcb *cf, const struct fcb_entry_ctx *entry_ctx, const char *const name)
{
	struct fcb_entry_ctx entry2_ctx = *entry_ctx;
	while (fcb_getnext(&cf->cf_fcb, &entry2_ctx.loc) == 0) {
		char name2[SETTINGS_MAX_NAME_LEN + SETTINGS_EXTRA_LEN + 1];
		size_t name2_len;
		if (settings_line_name_read(name2, sizeof(name2), &name2_len,
					    &entry2_ctx)) {
			LOG_ERR("failed to load line");
			continue;
		}
		name2[name2_len] = '\0';
		if (!strcmp(name, name2)) {
			return true;
		}
	}
	return false;
}