mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-13 00:17:23 +00:00
cmd: avoid endless loop in sound play command
A parameter starting with a hyphen leads to an endless loop in the sound play command. Leave it to dectoul() to handle the hyphen. It will return 0 for a negative number. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
582e3c9fb2
commit
532952f63c
1 changed files with 2 additions and 2 deletions
|
@ -48,12 +48,12 @@ static int do_play(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||||
++argv;
|
++argv;
|
||||||
while (argc || first) {
|
while (argc || first) {
|
||||||
first = false;
|
first = false;
|
||||||
if (argc && *argv[0] != '-') {
|
if (argc) {
|
||||||
msec = dectoul(argv[0], NULL);
|
msec = dectoul(argv[0], NULL);
|
||||||
--argc;
|
--argc;
|
||||||
++argv;
|
++argv;
|
||||||
}
|
}
|
||||||
if (argc && *argv[0] != '-') {
|
if (argc) {
|
||||||
freq = dectoul(argv[0], NULL);
|
freq = dectoul(argv[0], NULL);
|
||||||
--argc;
|
--argc;
|
||||||
++argv;
|
++argv;
|
||||||
|
|
Loading…
Reference in a new issue