]> git.dujemihanovic.xyz Git - u-boot.git/commit
env: allow to copy value from default environment into a buffer
authorQuentin Schulz <quentin.schulz@theobroma-systems.com>
Wed, 17 Jan 2024 17:59:11 +0000 (18:59 +0100)
committerKever Yang <kever.yang@rock-chips.com>
Fri, 19 Jan 2024 02:57:36 +0000 (10:57 +0800)
commit23c1ab92be6332fb528efc2d549898a5f1d17bf9
tree52cd26e59568ff44b75562c40d3eafa9d7dfbfb9
parent56bb09f5022d46d1244ba02680b6a7f2a0317598
env: allow to copy value from default environment into a buffer

env_get_default suffers from a particular issue int that it can only
return a value truncated to gd->env_buf (32) characters. This may be
enough for most variables but it isn't for others, so let's allow users
to provide a preallocated buffer to copy the value into instead,
allowing for more control, though it'll still be truncated if the value
size is bigger than the preallocated buffer.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
env/common.c
include/env.h