From bbaae959bdef565ceb474b3c968aca9331594ea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= Date: Wed, 12 Dec 2018 01:12:13 +0100 Subject: [PATCH] lib/fit: Normalize spaces in board names to dashes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CONFIG_MAINBOARD_PART_NUMBER sometimes contains spaces, but spaces inside compat strings aren't nice, so let's convert all spaces to dashes. Change-Id: I46f2b2d7091782e04df5476e50698001511f664b Signed-off-by: Jonathan Neuschäfer Reviewed-on: https://review.coreboot.org/c/30173 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner --- src/lib/fit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/fit.c b/src/lib/fit.c index da550723d2..090d34afd7 100644 --- a/src/lib/fit.c +++ b/src/lib/fit.c @@ -38,12 +38,12 @@ struct compat_string_entry { struct list_node list_node; }; -/* Convert string to lowercase and replace '_' with '-'. */ +/* Convert string to lowercase and replace '_' and spaces with '-'. */ static char *clean_compat_string(char *str) { for (size_t i = 0; i < strlen(str); i++) { str[i] = tolower(str[i]); - if (str[i] == '_') + if (str[i] == '_' || str[i] == ' ') str[i] = '-'; }