term.h: Avoid returining 0-sized terminal as it may lead to division by zero.

This commit is contained in:
Vladimir Serbinenko committed 2015-01-21 17:42:13 +01:00
1 parent 475bffeae6
commit 1b6aaddc45
2 files changed
+7 -2

No files matched your search

+5
View File
@@ -1,3 +1,8 @@
2015-01-20 Vladimir Serbinenko <phcoder@gmail.com>
* include/grub/term.h: Avoid returining 0-sized terminal
as it may lead to division by zero.
2015-01-20 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/fs/zfs.c: Avoid divisions by zero.
+2 -2
View File
@@ -334,12 +334,12 @@ void grub_term_restore_pos (struct grub_term_coordinate *pos);
static inline unsigned grub_term_width (struct grub_term_output *term)
{
return term->getwh(term).x;
return term->getwh(term).x ? : 80;
}
static inline unsigned grub_term_height (struct grub_term_output *term)
{
return term->getwh(term).y;
return term->getwh(term).y ? : 24;
}
static inline struct grub_term_coordinate