* grub-core/commands/i386/pc/play.c (grub_cmd_play): Improve error
handling.
This commit is contained in:
parent
794d8ef2af
commit
306fc0741f
2 changed files with 11 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2012-02-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/commands/i386/pc/play.c (grub_cmd_play): Improve error
|
||||||
|
handling.
|
||||||
|
|
||||||
2012-02-12 Vladimir Serbinenko <phcoder@gmail.com>
|
2012-02-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/commands/hdparm.c (grub_cmd_hdparm): Allow running
|
* grub-core/commands/hdparm.c (grub_cmd_hdparm): Allow running
|
||||||
|
|
|
@ -237,16 +237,20 @@ grub_cmd_play (grub_command_t cmd __attribute__ ((unused)),
|
||||||
for (i = 1; i + 1 < argc; i += 2)
|
for (i = 1; i + 1 < argc; i += 2)
|
||||||
{
|
{
|
||||||
note.pitch = grub_strtoul (args[i], &end, 0);
|
note.pitch = grub_strtoul (args[i], &end, 0);
|
||||||
|
if (grub_errno)
|
||||||
|
break;
|
||||||
if (*end)
|
if (*end)
|
||||||
{
|
{
|
||||||
grub_error (GRUB_ERR_BAD_NUMBER, "bogus pitch number");
|
grub_error (GRUB_ERR_BAD_NUMBER, N_("unrecognized number"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
note.duration = grub_strtoul (args[i + 1], &end, 0);
|
note.duration = grub_strtoul (args[i + 1], &end, 0);
|
||||||
|
if (grub_errno)
|
||||||
|
break;
|
||||||
if (*end)
|
if (*end)
|
||||||
{
|
{
|
||||||
grub_error (GRUB_ERR_BAD_NUMBER, "bogus duration number");
|
grub_error (GRUB_ERR_BAD_NUMBER, N_("unrecognized number"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue