summaryrefslogtreecommitdiff
path: root/payloads/nvramcui
diff options
context:
space:
mode:
authorVladimir Serbinenko <phcoder@gmail.com>2014-01-15 22:07:52 +0100
committerNico Huber <nico.h@gmx.de>2014-01-19 15:09:29 +0100
commitc9babb278f2de86022979db04628e99f333b73c8 (patch)
treee650d3a58ab5fe53039960987c5f02870a1fb231 /payloads/nvramcui
parent571bec726c4c5fe0d95ae4ad3604e49e859f8861 (diff)
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)
Diffstat (limited to 'payloads/nvramcui')
-rw-r--r--payloads/nvramcui/nvramcui.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/payloads/nvramcui/nvramcui.c b/payloads/nvramcui/nvramcui.c
index 04367cd5f9..daf153b9d7 100644
--- a/payloads/nvramcui/nvramcui.c
+++ b/payloads/nvramcui/nvramcui.c
@@ -232,6 +232,10 @@ int main()
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);
}