diff mbox series

[libubootenv] Variables are not removed when loading from file

Message ID 20200209150759.8481-1-sbabic@denx.de
State Accepted
Headers show
Series [libubootenv] Variables are not removed when loading from file | expand

Commit Message

Stefano Babic Feb. 9, 2020, 3:07 p.m. UTC
Instead of removing a variable, variable is assigned to a zero-length
string.

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 src/uboot_env.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/src/uboot_env.c b/src/uboot_env.c
index 475ce0c..8926373 100644
--- a/src/uboot_env.c
+++ b/src/uboot_env.c
@@ -1068,6 +1068,9 @@  int libuboot_load_file(struct uboot_ctx *ctx, const char *filename)
 
 		name = buf;
 
+		if (!strlen(value))
+			value = NULL;
+
 		libuboot_set_env(ctx, name, value);
 	}
 	fclose(fp);