diff options
author | Andrey Petrov <andrey.petrov@intel.com> | 2015-10-07 13:37:49 -0700 |
---|---|---|
committer | Alexandru Gagniuc <mr.nuke.me@gmail.com> | 2015-10-08 22:39:36 +0000 |
commit | a2bed346a1a45c822bc255e90a0bf6a6ae1d1d50 (patch) | |
tree | f21a19855d64b6ec3ae1c8365f08d5d1a3cf1b67 /util/cbfstool/flashmap | |
parent | ee2740b7f63a7266e218fb97b657a67a8d1fde50 (diff) | |
download | coreboot-a2bed346a1a45c822bc255e90a0bf6a6ae1d1d50.tar.xz |
cbfstool: allow printable characters in image name
Currently cbfstool would reject non-alpanumeric characters in
image names. Underscore is not alphanumeric and is used in some
default fmaps. This change allows image names to contain all
"printable" characters except spaces.
Change-Id: I6ba2b581d5623f5b028149ece0169892ea63fd04
Signed-off-by: Andrey Petrov <andrey.petrov@intel.com>
Reviewed-on: http://review.coreboot.org/11807
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'util/cbfstool/flashmap')
-rw-r--r-- | util/cbfstool/flashmap/fmap.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/util/cbfstool/flashmap/fmap.c b/util/cbfstool/flashmap/fmap.c index f803d6c0da..24181d0b43 100644 --- a/util/cbfstool/flashmap/fmap.c +++ b/util/cbfstool/flashmap/fmap.c @@ -89,12 +89,12 @@ static int is_valid_fmap(const struct fmap *fmap) while (i < FMAP_STRLEN) { if (fmap->name[i] == 0) break; - if (!isalnum(fmap->name[i])) + if (!isgraph(fmap->name[i])) return 0; if (i == FMAP_STRLEN - 1) { - /* name is specified to be null terminated. We didn't - * break in the 0 test, we didn't fail on the alnum - * test, so we're seeing FMAP_STRLEN alphanumerical + /* name is specified to be null terminated single-word string + * without spaces. We did not break in the 0 test, we know it + * is a printable spaceless string but we're seeing FMAP_STRLEN * symbols, which is one too many. */ return 0; |