mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-24 21:54:01 +00:00
cmd/command.c: relax length check in cmd_get_data_size()
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>
This commit is contained in:
parent
48f31ee742
commit
92fa22a1bb
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue