* grub-core/commands/i386/pc/play.c (grub_cmd_play): Improve error

handling.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-02-12 17:38:13 +01:00
parent 794d8ef2af
commit 306fc0741f
2 changed files with 11 additions and 2 deletions

View file

@ -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

View file

@ -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;
} }