nvramcui: Trim values when setting.

Values get space-padded by curses and then enum search fails to match them.
Rtrim to compensate for curses.

Change-Id: Iecf095f21cfade9425eaa039b67625615eb80481
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/4692
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins)
diff --git a/payloads/nvramcui/nvramcui.c b/payloads/nvramcui/nvramcui.c
index 04367cd..daf153b 100644
--- a/payloads/nvramcui/nvramcui.c
+++ b/payloads/nvramcui/nvramcui.c
@@ -232,6 +232,10 @@
 	for (i = 0; i < numopts; i++) {
 		char *name = field_buffer(fields[2*i], 0);
 		char *value = field_buffer(fields[2*i+1], 0);
+		char *ptr;
+		for (ptr = value + strlen (value) - 1;
+		     ptr >= value && *ptr == ' '; ptr--);
+		ptr[1] = '\0';
 		set_option_from_string(use_nvram, opttbl, value, name);
 	}