Improve gettext support. Stylistic fixes and error handling fixes while
on it.
This commit is contained in:
parent
215c90cb82
commit
9c4b5c13e6
184 changed files with 1175 additions and 959 deletions
|
@ -26,7 +26,7 @@ grub_netbuff_put (struct grub_net_buff *nb, grub_size_t len)
|
|||
{
|
||||
nb->tail += len;
|
||||
if (nb->tail > nb->end)
|
||||
return grub_error (GRUB_ERR_OUT_OF_RANGE, "put out of the packet range.");
|
||||
return grub_error (GRUB_ERR_BUG, "put out of the packet range.");
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ grub_netbuff_unput (struct grub_net_buff *nb, grub_size_t len)
|
|||
{
|
||||
nb->tail -= len;
|
||||
if (nb->tail < nb->head)
|
||||
return grub_error (GRUB_ERR_OUT_OF_RANGE,
|
||||
return grub_error (GRUB_ERR_BUG,
|
||||
"unput out of the packet range.");
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ grub_netbuff_push (struct grub_net_buff *nb, grub_size_t len)
|
|||
{
|
||||
nb->data -= len;
|
||||
if (nb->data < nb->head)
|
||||
return grub_error (GRUB_ERR_OUT_OF_RANGE,
|
||||
return grub_error (GRUB_ERR_BUG,
|
||||
"push out of the packet range.");
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ grub_netbuff_pull (struct grub_net_buff *nb, grub_size_t len)
|
|||
{
|
||||
nb->data += len;
|
||||
if (nb->data > nb->end)
|
||||
return grub_error (GRUB_ERR_OUT_OF_RANGE,
|
||||
return grub_error (GRUB_ERR_BUG,
|
||||
"pull out of the packet range.");
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ grub_netbuff_reserve (struct grub_net_buff *nb, grub_size_t len)
|
|||
nb->data += len;
|
||||
nb->tail += len;
|
||||
if ((nb->tail > nb->end) || (nb->data > nb->end))
|
||||
return grub_error (GRUB_ERR_OUT_OF_RANGE,
|
||||
return grub_error (GRUB_ERR_BUG,
|
||||
"reserve out of the packet range.");
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue