settings: Fix settings runtime read callback return value

The settings runtime read callback should return the actual length of
the data that has been read.

Signed-off-by: François Delawarde <fnde@oticon.com>
This commit is contained in:
François Delawarde 2019-12-12 09:09:48 +01:00 committed by Alberto Escolar
parent f7f63c6306
commit bec05a5d7f

View file

@ -20,7 +20,7 @@ static ssize_t settings_runtime_read_cb(void *cb_arg, void *data, size_t len)
struct read_cb_arg *arg = (struct read_cb_arg *)cb_arg;
memcpy(data, arg->data, MIN(arg->len, len));
return len;
return MIN(arg->len, len);
}
int settings_runtime_set(const char *name, void *data, size_t len)