git.openpandora.org
/
pandora-u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
48f31ee
)
cmd/command.c: relax length check in cmd_get_data_size()
author
Rasmus Villemoes
<rasmus.villemoes@prevas.dk>
Wed, 3 Jan 2024 10:47:06 +0000
(11:47 +0100)
committer
Tom Rini
<trini@konsulko.com>
Tue, 16 Jan 2024 22:05:29 +0000
(17:05 -0500)
Just check that the length is at least 2. This allows passing strings
like ".b", which can be convenient when constructing
tests (i.e. parametrizing the suffix used).
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
common/command.c
patch
|
blob
|
history
diff --git
a/common/command.c
b/common/command.c
index
83feaac
..
af8ffdb
100644
(file)
--- a/
common/command.c
+++ b/
common/command.c
@@
-470,7
+470,7
@@
int cmd_get_data_size(const char *arg, int default_size)
/* Check for a size specification .b, .w or .l.
*/
int len = strlen(arg);
- if (len > 2 && arg[len-2] == '.') {
+ if (len >
=
2 && arg[len-2] == '.') {
switch (arg[len-1]) {
case 'b':
return 1;